API reference
What Saylek's API surface serves: the endpoints, how streaming and model ids behave, and how a call fails. For RC integrations, use the hosted Saylek API. Start with Connect your app to choose the format your client uses.
It is not a list of request-body fields. Per-field support beyond stream and the model
id is unpublished, and rather than print a list we have not established, we are leaving it
unstated. One family is published: the chat path's four thinking controls, whose handling
is stated in full under Thinking
controls.
Base URLs
| Surface | Base URL | Auth |
|---|---|---|
| Hosted, OpenAI dialect | https://api.saylek.com/v1 | Authorization: Bearer <key> |
| Hosted, Anthropic dialect | https://api.saylek.com | x-api-key or Authorization: Bearer, plus anthropic-version |
The Anthropic base URL carries no /v1, because Anthropic clients append
/v1/messages themselves. The OpenAI base URL does. Getting this backwards is the most
common cause of a 404.
Advanced: local daemon reference
The following table is retained for troubleshooting existing local installations, not as
the recommended RC application setup. The local daemon API at 127.0.0.1:7295
(127.0.0.1:8443 on a machine set up earlier) does not authenticate requests. Do not
expose it to a network. A loopback connection is not a local-only guarantee; see
Privacy and egress.
For hosted request examples, use OpenAI setup or Anthropic setup. Do not infer hosted endpoint support from this local table.
The daemon serves the following OpenAI-dialect routes:
| Endpoint | Purpose |
|---|---|
GET /v1/models | What this daemon can serve: models discovered on this machine, plus any upstreams you configured. It is not the list of what you can reach. For that, run saylek models --account. |
POST /v1/chat/completions | Chat completions. The main path, and the one to build on. Its handling of reasoning_effort and the three sibling thinking fields is published under Thinking controls. |
POST /v1/embeddings | Embeddings. |
POST /v1/audio/transcriptions | Audio transcription, but no released build ships a speech model, so where nothing serves the model you name for speech it refuses rather than guessing. saylek host engine add <url> adopts an engine of your own, and a model on it that transcribes is forwarded your clip. |
POST /v1/responses | Responses-style calls, but on this daemon only against a proxy upstream you have configured. A local model or a machine shared with you returns model_not_found here. The hosted surface is a different path: it has answered a plain, non-streaming text request from a shared machine. |
POST /v1/completions | Not implemented. The route exists and answers 501. It is listed so you do not spend an afternoon wondering why the legacy path 404s differently than you expected. Use the chat path. |
The hosted Anthropic surface adds POST /v1/messages, covered on Claude Code and the
Anthropic SDK.
Streaming
stream: true is supported on the chat path and emits standard OpenAI SSE frames, so a
client that already consumes OpenAI streaming works without changes.
A streamed request that fails after the stream has started does not change the status code:
the response is already HTTP 200, so the error arrives as a frame,
data: {"error":{"code":…,"message":…,"details":{"reason":…}}}, with no [DONE] after it.
Check each frame for error rather than relying on the status.
Model ids and your aliases
Saylek carries a model id exactly as the machine serving it advertises it, and adds no names
of its own: gpt-4o, claude-3-5-sonnet and similar names from other providers do not
resolve, even through the Anthropic dialect. Always discover first:
curl https://api.saylek.com/v1/models -H "Authorization: Bearer YOUR_API_KEY"
The names that do resolve, besides model ids, are your aliases. An alias is a name you
choose for up to eight models, made with Add alias on Models. It is yours
alone: it resolves only for requests made with your keys. Send it as model on chat
completions, responses, messages, embeddings or audio transcriptions, and any model under it
that can serve the request may answer. A model whose id is exactly the alias's text is one of
its models too.
GET /v1/models lists each alias as a row of its own, in place of the model row with the
same id. Its alias_of field lists the alias's models in order, each with served (it
can serve you right now) and listed (false for the model included because its id is
the alias's text).
Which model answered
The model field of a response repeats what you sent. When you send an alias, the response
also names the model that served it:
- A response that is not streamed carries the header
X-Saylek-Served-Model: the serving model's id, percent-encoded UTF-8. A request made by a model id carries none. - A streamed response carries a top-level
saylek_served_modelstring in the JSON of everydata:frame. The[DONE]frame and comment frames carry none.
The saylek client on your machine sends X-Saylek-Cross-Name-Receipts: 1 to say it can check
a receipt signed for a model other than the alias it asked for. Do not set it yourself.
Alias refusal codes
A request made with an alias can be refused with these codes, in every dialect. The error
names the alias you sent in requested_model, except on reach_read_maximum_reached, which
names no model. The 503s carry Retry-After: 5.
| Status | code | Retry | What it means | What to do |
|---|---|---|---|---|
503 | member_names_unreadable | Yes | Your aliases could not be read just now. | Retry after Retry-After. |
503 | member_name_not_served_now | Yes | This is one of your aliases, and none of its models could be confirmed to serve this request right now. | Retry after Retry-After. |
503 | reach_read_maximum_reached | Yes | This request reached the per-request maximum of people who share with you or machines it can read, and none it read can serve it. | Retry after Retry-After. |
400 | member_machine_update_required | No | The request came through the saylek client on your machine, and that version cannot check an answer from another of the alias's models. | Update saylek on that machine. |
400 | no_capable_model | No | Nothing you can reach under the alias, or under the model id, supports everything this request asks for. error.details.unserved names what is missing. | Change the request, or list a model that supports it under the alias. |
404 | member_name_not_served | No | This is one of your aliases, and none of its models is served for you. | Check its models on Models. |
A tool that reaches Saylek through the saylek client on your machine can also receive
503 served_model_unconfirmed, with Retry-After, when that client could not confirm
which model answered an alias. Retry after Retry-After.
Rate limiting and availability
There is a rate limiter, and it is on by default. Your local daemon ships with a limit of
100 requests per second with a burst allowance of 200, and it answers HTTP 429
when you exceed it. It is a spike absorber rather than a quota: you are unlikely to meet it
by hand, and quite likely to meet it with a parallel batch job. Handle 429 and back off. The
values live under [ratelimit] in ~/.saylek/config.toml if you need to change them on
your own machine.
What does not exist yet is a published quota or token ceiling on the hosted surface. Rather than print a number we have not committed to, we are leaving that unstated until it is real.
Availability is the failure mode that will actually bite you, because capacity comes from members' machines:
- A request that nothing you can reach takes right now can wait for a machine: up to its
application's Longest wait when it streams, and up to 60 seconds when it does not, or
less if the application gives it less time. You set the Longest wait under
Request settings on the application's card in Applications. It then
fails with the reason
wait_elapsed: a 429 when the machines that run it were busy, a 503 when none you can reach could serve it. It does not queue indefinitely. A model id that no machine you can reach serves fails at once withmodel_not_found. - Locally, a request for a model with nothing loaded returns
model_not_found. - A daemon built with no inference backend returns HTTP 503
no inference backend compiled in.
See Troubleshooting for the error shapes.
Limits and status codes a client has to handle
| Request body | 32 MiB on the chat, embeddings and responses paths. Larger bodies are rejected at the edge with 413. Audio transcription is bounded separately by the upload itself. |
| Rate | 100 requests/second, burst 200. Over that is 429. |
| Retry-After | Sent on the hosted API's 429 and 503 error responses. Honour it rather than retrying immediately. It tells you the earliest sensible retry, not that the retry will work, so read error.code to tell a busy moment from a condition that waiting does not fix. |
The status codes worth branching on:
| Code | What it means | What to do |
|---|---|---|
400 | The request is malformed. | Fix the request. Retrying will not help. |
401 | Key missing, wrong, or revoked. On the hosted surface only; a local daemon does not check keys. | Check the key. |
404 | The base URL or the model. A hosted 404 whose error.code is model_not_found is about the model; see Hosted error codes. Otherwise, suspect the base URL first. | Check whether your base URL should include /v1, then check the model id against GET /v1/models. |
413 | Body over 32 MiB. | Send less. |
429 | Rate limited, or every machine that could serve the request is busy. On the hosted surface, error.code says which; see Hosted error codes. | Back off and honour Retry-After, which is under 60 seconds when the machines are busy. |
501 | The route exists but is not implemented, for example /v1/completions. | Use the chat path. |
503 | Nothing could serve the request, for a reason a short wait does not clear. On the hosted surface, error.code says which case you hit; see Hosted error codes. A local daemon built with no inference backend also answers 503. | Honour Retry-After, and read error.code before deciding whether to retry. |
Hosted error codes
On the hosted surface, branch on the error body's code and not only on the HTTP status. Several
429s and 503s exist, and a 403 or 404 is not always about your key or your URL. Match
code exactly: the casing is mixed, so some codes arrive lowercase and some uppercase.
Apart from the GET /v1/models row, the table covers chat completions, responses and
messages requests. Hosted /v1/embeddings and /v1/audio/transcriptions return
model_not_found, NOT_IN_CIRCLE, CASCADE_EXHAUSTED, machine_offline,
outside_sharing_hours, sharing_paused and reach_read_maximum_reached too.
| Status | code | What it means | What to do |
|---|---|---|---|
404 | model_not_found | No machine you can reach serves this model id right now. | Check the id against GET /v1/models and send it exactly as listed. If someone runs this model, ask them to share a machine with you. Retrying the same id does not help until a machine you can reach serves it. |
403 | NOT_IN_CIRCLE | Nobody shares with you, and you have no machine of your own, so every model id gets this answer. | Ask someone to share a machine with you, or connect a machine of your own. Retrying on its own does not change this. |
429 | CASCADE_EXHAUSTED | The machines you can reach that run this model are all busy. | Retry after Retry-After. |
503 | CASCADE_EXHAUSTED | Nothing you can reach took this request. The machines that run this model for you are paused or offline, or Saylek could not confirm just now who shares with you. | Retry later, and check the machines you rely on are online if it keeps happening. |
429 | CAPACITY_FULL | Machines that run this model are all busy. | Retry after Retry-After. |
503 | machine_offline | A machine you can use runs this model, and it is offline right now. You still have access. | Retry after Retry-After. The model comes back when that machine reconnects. |
403 | sharing_paused | Only people who paused sharing with you run this model, and nothing else you can reach does. The message names them when they have a name on record. | Ask them to resume, or connect a machine of your own. Retrying does not help. |
503 | outside_sharing_hours | Every online machine shared with you that runs this model is outside the hours it's shared with you right now. Those are the machine's own sharing hours, or the hours its owner set for you. You still have access. | Retry at error.next_open_at (an RFC 3339 UTC instant), the next time one of those machines is shared with you; Retry-After is the seconds until then. When Saylek finds no opening within seven days, error.next_open_at is absent and Retry-After is the standard back-off. |
503 | reach_read_maximum_reached | This request reached the per-request maximum of people who share with you or machines it can read, and none it read can serve it. | Retry after Retry-After. |
503 | store_out_of_memory | Saylek's data store is out of memory and could not take this request. Nothing is wrong with your request or your access. | Retry after Retry-After. |
422 | listing_read_maximum_reached | GET /v1/models only. Your model list is larger than one read can return, because the people who share with you offer too many models across their machines. | Retrying does not help: the answer stays the same until the machines shared with you change. |
A refusal can also say why. When the request waited for a machine and none took it in time,
it carries the reason wait_elapsed (a 429 when the machines were busy, a 503 when none you can
reach could serve it): in error.reason on a non-streamed
request, and in error.details.reason in a streamed error frame. That happens after up to the
application's Longest wait when the request streams, and after up to 60 seconds when it does
not, or sooner if the application gives it less time.
In the OpenAI dialect, the error type follows the status rather than the cause: requests
for a 429, server_error for a 5xx, and invalid_request_error otherwise. The error also
carries a correlation_id, echoed in the X-Correlation-ID header; quote it when you report
a problem. The Anthropic dialect uses the same code values inside its own error envelope and
type names.
Keys
Member API keys are created at /applications. A key's secret is shown once, at creation.
Keys are member-scoped, so a key reaches everything shared with you in its region.
Revoke a key at /applications when it should stop working, for example if it leaked.
Where requests run
Every hosted call, and every local call your own machine cannot serve, goes through Saylek's registry to a machine that can serve it: one of your own machines, or one belonging to someone who shares with you. Build with that in mind: Privacy and egress covers routing details and existing-account exceptions, and is the page to read before sending anything sensitive through an integration.
Next steps
- Use your models from anywhere: hosted setup, end to end.
- Troubleshooting: 401s, 404s, and rejected model ids.
- Privacy and egress: what leaves the machine.
Last checked 2026-11-05 · read as markdown at /docs/api-reference.md