Unified AI API for developers. Access OpenAI, Google Gemini, Moonshot, and more through a single, elegant interface. Support both text completions and chat completions with Universal Connector.
Exnest AI provides OpenAI-compatible API with dual endpoints for text and chat completions. Use your own API keys or ours—your choice. Simple, secure, and production-ready.
Full TypeScript definitions with comprehensive type safety and IntelliSense support.
Built-in retry logic, error handling, and rate limiting for enterprise-grade applications.
Seamless integration with n8n and other automation tools using Bearer token authentication.
Use your own provider API keys directly or Exnest's managed keys with secure forwarding.
Everything you need to build AI-powered applications at scale, with clean APIs and minimal dependencies.
Access OpenAI, Google Gemini, Moonshot, and more through a single unified API.
Automatic retry with exponential backoff for maximum reliability and uptime.
Customize timeouts, retries, and options to match your specific requirements.
Built-in health monitoring and connection testing for proactive monitoring.
Multiple authentication methods and secure API key management.
Minimal dependencies and optimized performance for production environments.
Use your own API keys from providers directly or Exnest's managed keys with secure forwarding.
Clean, intuitive API design that gets out of your way and lets you focus on building.
// Text Completion - Single prompt
const completion = await fetch('https://api.exnest.app/v1/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer ex-sk-your-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gpt-4.1-mini',
prompt: 'What is the capital of France?',
max_tokens: 100
})
});
// Returns: { object: "text_completion", choices: [{ text: "..." }] }
// Chat Completion - Messages array
const chat = await fetch('https://api.exnest.app/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer ex-sk-your-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gpt-4.1-mini',
messages: [{ role: 'user', content: 'Hello!' }],
exnest_metadata: true // Get billing info
})
});
// Returns: { object: "chat.completion", choices: [{ message: {...} }] }
Flexibility to use your own provider API keys or Exnest's managed keys with zero security risk. Two endpoints for different use cases.
/v1/completions for single prompt (text_completion)
/v1/chat/completions for messages array (chat.completion)
External API keys are never stored. Securely forwarded directly to providers with zero logging.
Use Exnest's managed keys (ex-sk-*) with billing tracking or provider keys (sk-*) without billing.
Add exnest_metadata: true to get billing info, transaction ID, and cost breakdown.
Both endpoints support streaming with Server-Sent Events (SSE) for real-time responses.
All responses follow OpenAI format. Drop-in replacement for OpenAI API with extended features.
Access the world's leading AI models through a single, unified interface.
gpt-4.1-mini
gpt-4o / gpt-4o-mini
gemini-2.0-flash-exp
gemini-1.5-pro/flash
moonshot-v1-8k
moonshot-v1-32k/128k
More models coming soon
Connect with developers building the future of AI applications. Open source, active support, and comprehensive documentation.
Contributions welcome. Help shape the future of unified AI development.
Get help from the community and maintainers in GitHub discussions.
Detailed documentation and examples to get you started quickly.
OpenAI-compatible API with text and chat endpoints. Use your own keys or ours. Zero vendor lock-in. Start building in minutes.