AI Gateway
Access 340+ AI models through a single, OpenAI-compatible API
AI Gateway
Agnic's AI Gateway provides access to 340+ AI models from leading providers through a single, OpenAI-compatible API. Pay-per-use with your Agnic Wallet balance.
What is the AI Gateway?
The AI Gateway is a unified API that gives you access to models from:
- OpenAI - GPT-4o, GPT-4 Turbo, o1
- Anthropic - Claude 3.5 Sonnet, Claude 3 Opus
- Google - Gemini Pro, Gemini 1.5 Pro, Gemini 2.0 Flash
- Meta - Llama 3.3 70B, Llama 3.1 405B
- Plus 300+ more from Mistral, DeepSeek, Qwen, and others
Key Features
OpenAI Compatible
Drop-in replacement for OpenAI SDK. Just change your base URL.
340+ Models
Access models from every major AI provider in one place.
Pay Per Use
No subscriptions. Pay only for what you use from your USDC balance.
Free Models
Access Llama, Gemma, and Mistral models completely free.
How It Works
graph LR
A[Your App] --> B[Agnic AI Gateway]
B --> C[OpenAI]
B --> D[Anthropic]
B --> E[Google]
B --> F[Meta/Llama]
B --> G[300+ Others]- Send requests to
https://api.agnic.ai/v1 - Use your Agnic token for authentication
- Choose any model from 340+ available options
- Pay per request - costs deducted from your USDC balance
Quick Example
from openai import OpenAI
client = OpenAI(
api_key="agnic_tok_YOUR_TOKEN",
base_url="https://api.agnic.ai/v1"
)
response = client.chat.completions.create(
model="openai/gpt-4o", # or anthropic/claude-3.5-sonnet, etc.
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)Base URL
All AI Gateway endpoints use:
https://api.agnic.ai/v1Authentication
Use either authentication method:
| Method | Header | Token Format |
|---|---|---|
| API Token | Authorization: Bearer {token} | agnic_tok_... |
| OAuth2 | Authorization: Bearer {token} | agnic_at_... |
| Alternative | X-Agnic-Token: {token} | agnic_tok_... |
Pricing
Costs vary by model and are charged per token. We offer many free models including Llama, Gemma, and Mistral for development and testing.
View the complete list of 340+ models with live pricing at AI Gateway Pricing.
Spending Limits
Control your costs with built-in spending limits:
- Per-transaction limit - Maximum cost per API call
- Daily limit - Total spend allowed per day
- Monthly limit - Total spend allowed per month
Configure limits when creating your API token or during OAuth authorization.