Documentation
The API accepts the OpenAI Chat Completions and Anthropic Messages formats, so existing clients work with a different base URL and an API key.
Quickstart
A streamed request to deepseek-v4.1-flash-1017.
curl https://sableapi.com/v1/chat/completions \ -H "Authorization: Bearer $SABLE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek-v4.1-flash-1017", "stream": true, "messages": [ {"role": "user", "content": "List the regressions in this diff."} ] }'from openai import OpenAI client = OpenAI(base_url="https://sableapi.com/v1", api_key=SABLE_API_KEY) stream = client.chat.completions.create( model="deepseek-v4.1-flash-1017", stream=True, messages=[ {"role": "user", "content": "List the regressions in this diff."} ],)for chunk in stream: print(chunk.choices[0].delta.content or "", end="")curl https://sableapi.com/v1/messages \ -H "Authorization: Bearer $SABLE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek-v4.1-flash-1017", "max_tokens": 1024, "stream": true, "messages": [ {"role": "user", "content": "Summarise the open questions in this thread."} ] }'Base URL and authentication
- Base URL
https://sableapi.com/v1- Header
Authorization: Bearer <key>- Keys
- Created and revoked in your account.
Endpoints
| Method and path | Description |
|---|---|
POST /v1/chat/completions | OpenAI Chat Completions format. Streams with "stream": true. |
POST /v1/messages | Anthropic Messages format. Streams with "stream": true. |
GET /v1/models | Models available to the key. |
GET /v1/requests/{id} | The record of one request. |
Parameters
Sampling parameters are passed to the model as sent: temperature, top_p, top_k, min_p, frequency_penalty, presence_penalty, seed, stop and logit_bias.
Errors
Errors use the error format of the endpoint that was called, with a code field. A key may run any number of requests at once.
| Status | Code | Meaning |
|---|---|---|
400 | invalid_request | The request body is not valid. |
400 | context_length_exceeded | The input is longer than 512,000 tokens. |
401 | invalid_api_key | The API key is missing or not valid. |
402 | insufficient_credits | The balance is too low for the request. |
404 | model_not_found | The model is not available. |
409 | idempotency_conflict | The idempotency key was already used for a different request. |
503 | capacity_unavailable | All capacity is in use. Retry after the Retry-After header; reuse the idempotency key. |
503 | service_unavailable | The service is temporarily unavailable. Retry after the Retry-After header. |