APIMODELSAPIMODELS

OpenAI-compatible API: what it means and what actually works

Updated 2026-11-26

TL;DR Short answer: an OpenAI-compatible API accepts the same request and returns the same response shape as OpenAI's /v1/chat/completions, so you keep the OpenAI SDK and change three values: the base URL, the API key and the model name. Compatible does not mean identical. Every provider covers a different subset of endpoints and parameters, and the gaps are usually in structured outputs, tool calling details, streaming usage and error shapes. On APIMODELS, 58 chat models from OpenAI, Anthropic, Google, xAI, DeepSeek, Zhipu and Alibaba answer on one such endpoint.

Model page: GPT-6.2 Sol API — pricing, specs and the playground

OpenAI's chat completions format became the common language for LLM APIs because the first wave of tools was written against it. Editors, agent frameworks and chat clients all know how to talk to a URL that ends in /v1/chat/completions, so other providers and gateways answer in that format too. For a developer it means one integration can reach many models: you do not rewrite the code that builds messages, parses tool calls or reads the stream.

What follows is specific to APIMODELS and was checked against the running service on 26 November 2026: which endpoints exist, how each parameter is handled for each model family, and where the behavior differs from OpenAI's own API. Where something does not work, the table says so.

The three values you change

SettingWith OpenAIWith APIMODELS
Base URLhttps://api.openai.com/v1https://api.apimodels.app/v1
API keyAn OpenAI keyAn APIMODELS key, sent as Authorization: Bearer (x-api-key also works)
Model namegpt-6.2-solgpt-6.2-sol, or claude-sonnet-5-5, gemini-4-argon, grok-4.6, deepseek-v4-pro, glm-5.3, qwen4-max and others from /v1/models

Which OpenAI endpoints exist on APIMODELS

EndpointStatusNotes
POST /v1/chat/completionsYes58 chat models: Claude and Gemini requests are translated to each vendor's native API and back
POST /v1/responsesYesGPT and other OpenAI-format models; Claude and Gemini are not served here, use chat completions
POST /v1/embeddingsYestext-embedding-3-small and text-embedding-3-large
POST /v1/completions (legacy)YesOpenAI-format language models only
GET /v1/modelsYes, no key needed191 models; each has two extra fields, modality and endpoint
POST /v1/images/editsYesOpenAI multipart format, returns the OpenAI shape
POST /v1/images/generationsYes, different by defaultAsynchronous: returns a task ID that you poll, not the OpenAI image response
POST /v1/audio/speechPartlymp3 and pcm output only; instructions is ignored; speed 0.7 to 1.2
/v1/realtimeOne modelgrok-voice-3.0 only
/v1/filesNot the OpenAI Files APIAn upload endpoint for media inputs with its own response shape
Assistants, threads, batches, fine-tuning, moderations, audio/transcriptionsNoThese paths return 404 unknown_endpoint

How chat completions parameters are handled, by model family

GPT, Grok, DeepSeek, GLM and Qwen speak this format natively, so supported fields are forwarded as they are. Claude and Gemini requests are translated, and a field with no equivalent on the other side is dropped without an error. Forwarded means the upstream receives it; whether a given model honors it is up to that model.

ParameterGPT, Grok, DeepSeek, GLM, QwenClaudeGemini
streamYesYes, as chat.completion.chunk events ending in [DONE]Yes
tools (function calling)ForwardedFunction tools onlyFunction tools only; schema reduced to what Gemini accepts
tool_choiceForwardedauto, none, required and a named functionauto, none, required
parallel_tool_callsForwardedfalse is honoredDropped
response_format: json_schemaForwardedMapped to structured outputsReturns JSON, but the schema itself is not enforced
Image input (image_url)Forwarded; GLM-5.2 and GLM-5.3 reject images with a 400Yes, data URLs and linksYes; video_url is accepted too
max_tokens / max_completion_tokensBoth forwardedEither oneEither one
temperature, top_p, stopForwardedMapped; limited when thinking is onMapped
n, logprobs, seedForwardedDroppedDropped
reasoning_effortForwardedMapped per modellow, medium, high; none and minimal become low
Web searchUse /v1/responses; not reliable on chat completionsNot available through this endpointweb_search tool or web_search_options, billed per search
service_tierDroppedNot applicableNot applicable

Where the behavior differs from OpenAI's API

1. Unknown fields are dropped silently. The chat endpoint forwards a fixed list of fields. A field outside that list does not cause an error and does not reach the model, so test that a setting has an effect before you rely on it.

2. The usage object has an extra cost field. Every response reports what was charged: usage.cost with currency, amount and the amount actually charged. In a stream, usage arrives in the final chunk whether or not you ask for it. Claude responses also carry Anthropic's own token fields next to the OpenAI ones.

3. Request IDs are in our own headers. Responses carry x-apimodels-request-id, and non-streaming responses also carry x-apimodels-cost. There is no x-request-id and there are no x-ratelimit headers.

4. Errors come in two shapes. A missing key, a missing model field or an unknown model family returns OpenAI's shape, an error object with message, type and code. A balance that is too low (402), a model name that is not found inside a known family (404) and errors passed on from upstream return a shape without code, with type at the top level as well. Both have error.message and error.type; do not depend on error.code being present.

5. Balance is checked before the request runs. We reserve the estimated input plus max_tokens at the output price. A very large max_tokens can be rejected with a 402 even though the answer would have been short.

6. Some OpenAI model aliases are rewritten. gpt-5.6 resolves to gpt-5.6-sol, for example, and the response reports the resolved name.

Clients with a setup guide

Any client that lets you set an OpenAI base URL and key can use the endpoint. We keep step-by-step guides for Cursor, Codex, OpenCode, Cherry Studio, n8n, OpenClaw and WorkBuddy, and one client setup page that covers the rest, including Aider, ChatBox, Continue, LobeChat and NextChat. Claude Code and Gemini CLI use the vendors' native formats rather than the OpenAI one, and have their own guides. All of them are linked under Related pages below.

Quick start

cURL

# Same request, three vendors: only the model name changes
for MODEL in gpt-6.2-sol claude-sonnet-5-5 gemini-4-argon; do
  curl -s https://api.apimodels.app/v1/chat/completions \
    -H "Authorization: Bearer $APIMODELS_API_KEY" \
    -H "Content-Type: application/json" \
    -d "{
      \"model\": \"$MODEL\",
      \"max_tokens\": 128,
      \"messages\": [{\"role\": \"user\", \"content\": \"Name one use for a paperclip.\"}]
    }"
  echo
done

Python

import openai

# The OpenAI SDK, unchanged. Only base_url and api_key differ from calling OpenAI.
client = openai.OpenAI(
    base_url="https://api.apimodels.app/v1",
    api_key="sk_...your_apimodels_key...",
)

for model in ["gpt-6.2-sol", "claude-sonnet-5-5", "gemini-4-argon"]:
    r = client.chat.completions.create(
        model=model,
        max_tokens=128,
        messages=[{"role": "user", "content": "Name one use for a paperclip."}],
    )
    # usage.cost is an APIMODELS extension: what this request was charged
    cost = (r.usage.model_extra or {}).get("cost", {})
    print(model, "->", r.choices[0].message.content, "| charged", cost.get("charged"), cost.get("currency"))

FAQ

What does "OpenAI-compatible API" mean?

It means the service accepts requests in the format of OpenAI's /v1/chat/completions and answers in the same structure, so software written for OpenAI works after you change the base URL, the API key and the model name. It describes the wire format only. It does not mean the models are OpenAI's, and it does not promise every OpenAI endpoint or parameter.

Is an OpenAI-compatible API exactly the same as OpenAI's API?

No. The request and response shapes match for the common cases, but each provider supports its own subset. On APIMODELS the differences are: unknown fields are dropped silently, n, logprobs and seed do not reach Claude or Gemini, Gemini returns JSON without enforcing a json_schema, errors come in two shapes, and there is no Assistants, Batch, fine-tuning or moderation endpoint.

Are Claude and Gemini OpenAI-compatible?

Not natively: each has its own API format, and each vendor offers a compatibility layer with limits. Anthropic describes its OpenAI SDK compatibility as not a long-term or production-ready solution for most use cases, and Google's OpenAI library support is still in beta. On APIMODELS you can call 21 Claude models and 12 Gemini models through /v1/chat/completions; the request is translated to the vendor's native API, including streaming, function calling and image input.

Does an OpenAI-compatible API cover every OpenAI endpoint?

Rarely. Most providers implement chat completions and little else. APIMODELS has chat completions, responses, embeddings, legacy completions, models, image edits and a partial audio speech endpoint. Image generation exists but is asynchronous by default. Assistants, threads, batches, fine-tuning, moderations and audio transcriptions are not implemented and return 404.

Can I switch models without changing my code?

For plain chat, yes: change the model string and nothing else. For anything beyond that, test first. Tool calling works across GPT, Claude and Gemini, but parallel_tool_calls is dropped on Gemini, structured output with a schema is enforced on GPT and Claude and not on Gemini, and sampling settings such as seed only reach OpenAI-format models. The parameter table above lists each case.

Related

Featured on
APIMODELS on Product HuntAPIMODELS featured on ToolifyAPIMODELS featured on There's An AI For That