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.

Base URL https://api.anymodl.com/v1

Send your key on every request:

http
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.

python
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)
javascript
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);
bash
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

POST/v1/chat/completions

OpenAI-compatible chat endpoint. Every parameter the OpenAI SDK sends is accepted.

Request parameters

ParameterTypeDescription
modelrequiredstringAny model ID from anymodl.com/models.
messagesrequiredarrayConversation messages. Each object: role ("user", "assistant", "system") + content.
streamoptionalbooleanReturn SSE stream. Default: false.
temperatureoptionalnumberSampling temperature 0–2. Default: 1.
max_tokensoptionalintegerMax tokens to generate.
top_poptionalnumberNucleus 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:

sse
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:

Response header X-Credits-Remaining-USD: 4.2173

Images

POST/v1/images/generations

Generate images from text prompts. Use FLUX model IDs. FLUX.1-schnell is fast and economical.

ParameterTypeDescription
modelrequiredstringFLUX model ID, e.g. black-forest-labs/FLUX.1-schnell.
promptrequiredstringText description of the image.
noptionalintegerNumber of images. Default: 1.
sizeoptionalstringDimensions, e.g. "1024x1024".

Response: {"data": [{"url": "https://..."}]}. Download and store images — URLs are temporary.

Embeddings

POST/v1/embeddings

Convert text to 1024-dimensional multilingual vectors for RAG, semantic search, clustering, and memory.

ParameterTypeDescription
modelrequiredstringEmbedding model ID. See Models for options.
inputrequiredstring or arrayText to embed. Batch up to 512 inputs.
python
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.

MCP URLhttps://mcp.anymodl.com/mcp

Transport: streamable-http. Authenticate with the same bearer key as the REST API.

Claude Desktop / Claude Code configuration

json
{
  "mcpServers": {
    "anymodl": {
      "transport": "streamable-http",
      "url": "https://mcp.anymodl.com/mcp",
      "headers": { "Authorization": "Bearer YOUR_KEY" }
    }
  }
}

Available tools (12)

chat
Send a message to any model (605+ available)
list_models
Enumerate all models with pricing
get_credits
Check your current credit balance
list_services
Discover all live services
generate_image
Generate images with FLUX models
generate_image_premium
Premium image generation via Leonardo AI
generate_video
Async video job submission and polling
embed
Generate 1024-dim multilingual embeddings
search_domain
Check domain availability and pricing
register_domain
Register a domain name from your agent
manage_dns
Add, remove, or list DNS records
get_usage
Retrieve usage log for cost accounting

Rate Limits

Rate limits apply per API key and scale when your account has $5+ in deposits.

TierRequests / dayRequests / minute (RPM)
Free (under $5 deposited)30060
Paid ($5+ deposited)50,000600

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}}.

StatusMeaningRecommended action
400Bad request — invalid parametersCheck your request body against this reference
401Unauthorized — invalid or missing API keyVerify your key at /account
402Insufficient creditsTop up at /account
429Rate limit exceededRetry with exponential backoff starting at 1s
500Upstream model errorRetry once. If persistent, email hello@anymodl.com
503Service temporarily unavailableAutomatic 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.

bash
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.