api · 12 min

What “OpenAI-compatible” actually has to mean

Compatible with what, exactly? The request body is the easy half.

Supesonic · 30.08.2026 · Developer Library

For live models and prices, use the pricing page and marketplace. Dated examples in the Developer Library are planning aids, not quotes.

"OpenAI-compatible" covers a wide range. At one end is a faithful reimplementation where existing code moves unchanged. At the other is a URL that accepts a similar JSON body and returns a similar one. Both get described the same way.

The part everyone gets right

The request body: model, messages, temperature, max tokens, and a response with choices plus usage. That the base URL is the only change is the entire commercial proposition.

from openai import OpenAI

client = OpenAI(
    base_url="https://api.supesonic.com/v1",
    api_key="sk-...",
)

resp = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "hi"}],
)

Streaming, where implementations diverge

A faithful implementation forwards server-sent events as they arrive. A lazy one waits for the whole upstream response, then replays it as a burst of chunks. If your interface streams, test time-to-first-token and whether usage arrives on the final chunk.

Errors, which almost nobody gets right

The OpenAI error contract is specific: an HTTP status and a body with error type, code and message. Send a nonexistent model and a malformed body. You want typed errors — not HTTP 200 with a business failure in the body.

A ten-minute compatibility check

  1. GET /v1/models — does it list what you expect?
  2. A plain completion, non-streaming. Reconcile usage against the charge.
  3. The same request streaming. Time the first chunk.
  4. A nonexistent model name — expect a typed 404-class error.
  5. A malformed body — expect a typed 400-class error.
  6. A tool call if you use them — arguments parse as JSON.
  7. Abort a streaming request halfway and confirm the charge stops.

Our base URL is https://api.supesonic.com/v1. See the API docs.