# API compatibility

> What each sference surface accepts, which request fields are honored, and which are ignored.

Source: https://sference.com/docs/compatibility

sference speaks three request shapes: the OpenAI Chat Completions API, the OpenAI Responses API, and the Anthropic Messages API. This page is the honest map: what each surface accepts, what we honor, and what we ignore.

## Surfaces

| Surface | Endpoint | Shape |
| --- | --- | --- |
| OpenAI Chat API | `POST /v1/chat/completions` | OpenAI |
| OpenAI Responses API | `POST /v1/responses` | OpenAI |
| Anthropic Messages API | `POST /v1/messages` | Anthropic |
| Embeddings | `POST /v1/embeddings` | OpenAI |
| Batches | `POST /v1/batches` | OpenAI |
| Files | `POST /v1/files` | OpenAI |
| Streams | `POST /v1/streams` | sference extension |
| Models | `GET /v1/models` | OpenAI |

## Field support

### OpenAI Chat API

| Field | Status |
| --- | --- |
| `model`, `messages`, `stream` | ✅ |
| `temperature`, `top_p`, `top_k`, `min_p` | ✅ |
| `max_tokens`, `max_completion_tokens` | ✅ |
| `stop`, `seed` | ✅ |
| `presence_penalty`, `frequency_penalty`, `repetition_penalty` | ✅ |
| `tools`, `tool_choice` | ✅ |
| `response_format` (`json_schema`, `json_object`) | ✅ — see [Structured outputs](https://sference.com/docs/guides/structured-outputs) |
| `stream_options.include_usage` | ✅ |
| `reasoning_effort`, `enable_thinking` | ✅ on reasoning models |
| `prompt_cache_key` | ✅ sference extension — see [Prompt caching](https://sference.com/docs/guides/prompt-caching) |
| `service_tier` | ✅ `"flex"` selects flex; other accepted values serve as default |
| `max_queue_wait_s` | ✅ sference extension — see [Max queue wait](https://sference.com/docs/guides/max-queue-wait) |
| `n` (multiple completions) | ❌ not supported |
| `logprobs`, `top_logprobs` | ❌ not supported |
| `logit_bias` | ❌ not supported |

### OpenAI Responses API

| Field | Status |
| --- | --- |
| `model`, `input`, `instructions` | ✅ |
| `max_output_tokens`, `temperature`, `top_p` | ✅ |
| `tools`, `tool_choice` | ✅ |
| `text.format` | ✅ — structured output |
| `reasoning`, `include_reasoning`, `enable_thinking` | ✅ |
| `background` | ✅ — 24h batch window |
| `stream` | ✅ |
| `metadata.completion_window` | ✅ `"24h"` (requires `background: true`) |
| `metadata.stream_id` | ✅ sference extension — see [Streams](https://sference.com/docs/guides/streams) |
| `metadata.completion_webhook`, `metadata.webhook_token` | ✅ — see [Webhooks](https://sference.com/docs/guides/webhooks) |
| `prompt_cache_key`, `service_tier`, `max_queue_wait_s` | ✅ |
| `store` | ⚠️ accepted; there is no server-side storage |
| `previous_response_id`, `conversation` | ❌ ignored — send the conversation each turn |
| `include` (web search, file search, computer use) | ❌ ignored — see below |

> **No server-side conversation state**
>
> Every request is answered from the content you send. `previous_response_id` and `conversation` are **removed rather than rejected**, so your request still runs — it just does not see the turn they name. Send the full conversation in `input` on every turn; every OpenAI-compatible SDK does this by default.

### Anthropic Messages API

The full field-by-field map, including content blocks, streaming events, and the exact differences from `api.anthropic.com`, is on the [Anthropic Messages API](https://sference.com/docs/api/messages) page.

| Field | Status |
| --- | --- |
| `model`, `max_tokens`, `messages`, `system` | ✅ |
| `temperature`, `top_p`, `top_k` | ✅ |
| `stop_sequences`, `stream` | ✅ |
| `tools`, `tool_choice` | ✅ |
| `thinking`, `enable_thinking` | ✅ — `signature` is always empty |
| `max_queue_wait_s` | ✅ sference extension |
| `cache_control` | ❌ ignored — prefix caching is automatic |
| `service_tier`, `background` | ❌ realtime only on this surface |
| Server-side tools (web search, code execution, computer use) | ❌ unavailable |

## Not supported anywhere

| Feature | Why |
| --- | --- |
| Server-side tools — web search, file search, code execution, computer use | These are hosted by the provider, not the model. Run them in your own agent loop. |
| `n > 1` | One completion per request. Fan out with [concurrent requests](https://sference.com/docs/guides/requests-at-scale) instead. |
| Log probabilities | Not exposed by the serving engines we run. |
| Fine-tuning endpoints | Custom weights are hosted under an [enterprise agreement](https://sference.com/docs/custom-models), not self-serve. |
| Server-side conversation storage | Every request is stateless by design; see below. |

## Statelessness is deliberate

sference stores no conversation state. A response is computed from the request body alone, which is what makes the platform auditable: what you sent is what ran, and there is no hidden thread to reason about. It also means the request body is the source of truth for context — pass the whole conversation every turn.

## Checking support programmatically

Every model entry on `GET /v1/models` carries its capabilities:

```json
{
  "id": "zai-org/GLM-5.3-Flash",
  "context_tokens": 1048576,
  "capabilities": { "image_input": { "supported": true } },
  "pricing": { "input_per_million_usd": 0.2, "cached_input_per_million_usd": 0.07, "output_per_million_usd": 0.6 }
}
```

Read `capabilities` before routing a request that depends on one — vision in particular. The platform rejects rather than silently drops an unsupported input.

- [Support matrix](https://sference.com/docs/support): One-page grid of every endpoint and field.
- [Anthropic Messages API](https://sference.com/docs/api/messages): The full Anthropic compatibility surface.
- [Models](https://sference.com/docs/models): Catalog ids, capabilities, and pinning.
