Skip to content

OpenAI Compatible API

QuotaAPI provides an OpenAI-compatible API for OpenAI SDKs, Codex CLI, IDE plugins, agent frameworks and server-side integrations.

Base URL

text
https://quotarouter.ai/v1

Authentication:

http
Authorization: Bearer YOUR_QUOTAAPI_KEY

Chat Completions

bash
curl https://quotarouter.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_QUOTAAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [
      { "role": "system", "content": "You are a concise assistant." },
      { "role": "user", "content": "Explain QuotaAPI in one sentence." }
    ],
    "temperature": 0.7,
    "max_tokens": 120
  }'

Responses

bash
curl https://quotarouter.ai/v1/responses \
  -H "Authorization: Bearer YOUR_QUOTAAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "input": "Give me a short API connectivity test.",
    "max_output_tokens": 120
  }'

Embeddings

bash
curl https://quotarouter.ai/v1/embeddings \
  -H "Authorization: Bearer YOUR_QUOTAAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-large",
    "input": "QuotaAPI provides one API entry point for AI applications."
  }'

Embeddings are useful for retrieval, semantic search, similarity matching and knowledge-base indexing. This endpoint requires an OpenAI / GPT model group, and the request body must include model.

Image generation

bash
curl https://quotarouter.ai/v1/images/generations \
  -H "Authorization: Bearer YOUR_QUOTAAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A clean technical dashboard illustration for QuotaAPI.",
    "size": "1024x1024",
    "response_format": "b64_json"
  }'

Image generation creates images from text prompts. It requires:

  1. An API Key bound to an OpenAI / GPT model group.
  2. Image generation enabled for that group in the console.
  3. A gpt-image-* image model, such as gpt-image-2.

If model is omitted, QuotaAPI uses gpt-image-2 as the default image model. Use response_format: "b64_json" when your SDK should receive the image payload directly; URL responses can also be used when supported by the selected model and client.

Image edits

Image edits support multipart uploads:

bash
curl https://quotarouter.ai/v1/images/edits \
  -H "Authorization: Bearer YOUR_QUOTAAPI_KEY" \
  -F "model=gpt-image-2" \
  -F "prompt=Make the background darker and keep the object centered." \
  -F "[email protected]" \
  -F "size=1024x1024" \
  -F "response_format=b64_json"

You can also send image URLs in a JSON request:

bash
curl https://quotarouter.ai/v1/images/edits \
  -H "Authorization: Bearer YOUR_QUOTAAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "Replace the background with a quiet product studio.",
    "images": [
      { "image_url": "https://example.com/input.png" }
    ],
    "size": "1024x1024",
    "response_format": "b64_json"
  }'

Image edits use the same group permission as image generation. If you see Images API is not supported for this platform, the API Key is usually not using an OpenAI / GPT group. If you see Image generation is not enabled for this group, enable image generation for the group in the console.

Models

bash
curl https://quotarouter.ai/v1/models \
  -H "Authorization: Bearer YOUR_QUOTAAPI_KEY"

The model list depends on account permissions, model groups and console configuration. For production, confirm the model name in the console before putting it in client config.

Parameter notes

ParameterRecommendation
modelUse a model name enabled in the console
max_tokensUse for Chat Completions output limits
max_completion_tokensSupported by some newer models
max_output_tokensUse for Responses output limits
streamSet to true when the client supports streaming
inputMain input field for Responses and Embeddings
promptText prompt for image generation and image edits
sizeImage size, such as 1024x1024; usage records group image billing by count and size
response_formatImage endpoints can return b64_json or URL responses depending on model capability

For reasoning models, an output token limit that is too low may be rejected. Start at 16 or more and raise it for real tasks.

Error handling

QuotaAPI tries to preserve status codes and messages from the model service. Clients should handle:

StatusMeaning
400Request body, model name or parameters are invalid
401API Key is invalid
402Balance is insufficient
403No permission for the target group, model or image generation capability
429Rate or concurrency limit was reached
500Server-side error, check request records for details

TIP

For server-side integrations, keep https://quotarouter.ai/v1 and YOUR_QUOTAAPI_KEY in environment variables instead of hard-coding them.

QuotaAPI is an AI API relay service for developers and teams.