API Reference
anymodl is an OpenAI-compatible API. Change your base_url to https://api.anymodl.com/v1 and access 605+ models from OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek, xAI, Qwen, Black Forest Labs, Leonardo AI, and more — without changing your SDK code.
Authentication
All requests require a bearer token. Sign up at anymodl.com/account — you get $0.25 free credit instantly with no card required.
Send your key on every request:
Authorization: Bearer YOUR_ANYMODL_KEY
Keep your key private. Never expose it in client-side code or public repos. Rotate it instantly from /account if compromised.
Quickstart
Three steps: get key → set base_url → pick any model.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_ANYMODL_KEY",
base_url="https://api.anymodl.com/v1"
)
response = client.chat.completions.create(
model="gpt-4o", # or any of 605+ models
messages=[{"role": "user", "content": "Hello, world!"}]
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.ANYMODL_API_KEY,
baseURL: "https://api.anymodl.com/v1"
});
const response = await client.chat.completions.create({
model: "claude-opus-4-5", // or any of 605+ models
messages: [{ role: "user", content: "Hello, world!" }]
});
console.log(response.choices[0].message.content);
curl https://api.anymodl.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_ANYMODL_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.0-flash",
"messages": [{"role": "user", "content": "Hello, world!"}]
}'
The model field accepts any ID from anymodl.com/models. Swap between GPT-4o, Claude Opus, Gemini, Llama, Mistral, DeepSeek, and hundreds more with one string change.
Chat Completions
OpenAI-compatible chat endpoint. Every parameter the OpenAI SDK sends is accepted.
Request parameters
| Parameter | Type | Description |
|---|---|---|
| modelrequired | string | Any model ID from anymodl.com/models. |
| messagesrequired | array | Conversation messages. Each object: role ("user", "assistant", "system") + content. |
| streamoptional | boolean | Return SSE stream. Default: false. |
| temperatureoptional | number | Sampling temperature 0–2. Default: 1. |
| max_tokensoptional | integer | Max tokens to generate. |
| top_poptional | number | Nucleus sampling. Default: 1. |
Response follows the OpenAI ChatCompletion schema — choices[0].message.content contains the text.
Streaming
Set stream: true to receive tokens via server-sent events:
data: {"choices":[{"delta":{"content":"Hello"},"index":0}]}
data: {"choices":[{"delta":{"content":", world!"},"index":0}]}
data: [DONE]
Credit balance header
Every response includes your remaining balance:
Images
Generate images from text prompts. Use FLUX model IDs. FLUX.1-schnell is fast and economical.
| Parameter | Type | Description |
|---|---|---|
| modelrequired | string | FLUX model ID, e.g. black-forest-labs/FLUX.1-schnell. |
| promptrequired | string | Text description of the image. |
| noptional | integer | Number of images. Default: 1. |
| sizeoptional | string | Dimensions, e.g. "1024x1024". |
Response: {"data": [{"url": "https://..."}]}. Download and store images — URLs are temporary.
Embeddings
Convert text to 1024-dimensional multilingual vectors for RAG, semantic search, clustering, and memory.
| Parameter | Type | Description |
|---|---|---|
| modelrequired | string | Embedding model ID. See Models for options. |
| inputrequired | string or array | Text to embed. Batch up to 512 inputs. |
response = client.embeddings.create(
model="multilingual-e5-large",
input=["first document", "second document"]
)
vector = response.data[0].embedding # list of 1024 floats
MCP Server
anymodl exposes a Model Context Protocol (MCP) server. Claude Desktop, Claude Code, Cursor, and any MCP-compatible runtime can attach it with one config line.
Transport: streamable-http. Authenticate with the same bearer key as the REST API.
Claude Desktop / Claude Code configuration
{
"mcpServers": {
"anymodl": {
"transport": "streamable-http",
"url": "https://mcp.anymodl.com/mcp",
"headers": { "Authorization": "Bearer YOUR_KEY" }
}
}
}
Available tools (12)
Rate Limits
Rate limits apply per API key and scale when your account has $5+ in deposits.
| Tier | Requests / day | Requests / minute (RPM) |
|---|---|---|
| Free (under $5 deposited) | 300 | 60 |
| Paid ($5+ deposited) | 50,000 | 600 |
Handling 429 errors
On rate limit, use exponential backoff starting at 1 second. Double the delay on each retry, up to ~60 seconds. Contact hello@anymodl.com for higher limits.
Error Codes
Standard HTTP status codes. Error responses include {"error": {"message": "...", "type": "...", "code": N}}.
| Status | Meaning | Recommended action |
|---|---|---|
| 400 | Bad request — invalid parameters | Check your request body against this reference |
| 401 | Unauthorized — invalid or missing API key | Verify your key at /account |
| 402 | Insufficient credits | Top up at /account |
| 429 | Rate limit exceeded | Retry with exponential backoff starting at 1s |
| 500 | Upstream model error | Retry once. If persistent, email hello@anymodl.com |
| 503 | Service temporarily unavailable | Automatic failover in progress — retry in 30s |
anymodl maintains redundant routing. 503 errors are rare and typically resolve within 30 seconds as traffic shifts to a healthy route.
Models
Browse the full 605+ model catalog at anymodl.com/models. Includes model IDs, makers, and pricing. New models added continuously.
curl https://api.anymodl.com/v1/models \
-H "Authorization: Bearer YOUR_ANYMODL_KEY"
Ready to build?
Get your free API key — $0.25 credit included, no card required.