Every inference route, its request and its response.
Calling the API
This page lists every route you call models through, generated from the API itself: what each route does, the fields its request takes and what it answers.
The base URL is https://api.shardio.ai/v1. Inference routes are also served under https://api.shardio.ai/openai/v1, so a tool that expects an OpenAI path works there unchanged. Send your API key as a bearer token, Authorization: Bearer tsk_live_…, on authenticated routes. List prices and the marketplace model document below are public; the marketplace document is served only at its explicit /v1/marketplaces/openrouter/models path.
A refused request answers with an error object carrying a message, a type and a code. Errors explains every code and what to do about it.
Thinking controls
Chat completions accept a flat reasoning_effort or an OpenRouter-style reasoning object with effort and enabled. For example, "reasoning_effort": "medium" and "reasoning": {"effort": "medium"} choose the same effort on a model that supports it. This is support for those two object fields, not every OpenRouter reasoning control: reasoning.max_tokens and reasoning.exclude are rejected. The separate top-level max_tokens still limits total output; it is not a thinking-only budget.
The accepted choices depend on the model. none turns thinking off only where the model allows it. Models with effort levels accept their declared levels; XHigh (xhigh) is not Max (max). A toggle-only model has no tiers: any of minimal, low, medium, high, xhigh or max turns thinking on. SuperVL's native on is an extension, not an alias for high. Mandatory-thinking models refuse off settings.
Use "reasoning": {"enabled": true} to enable thinking without selecting an effort. If a level-based model defaults to off, this selects its declared enabled default; otherwise it leaves the enabled default in place. false turns thinking off where allowed. Omitting all thinking controls keeps the model's own default.
If you send more than one control, they must agree on the model's resulting setting. An enabled switch can accompany any supported non-off effort, but enabled: false conflicts with one. Different native levels conflict; two efforts that both mean On for a toggle-only model agree. The same rule covers enable_thinking and the controls in chat_template_kwargs. Unsupported or conflicting thinking settings are refused with reasoning_effort_unsupported before a credit hold or model dispatch.
Discovering thinking choices
Read each model's optional reasoning object from the public /catalog, or from the authenticated /v1/models list. In both responses it sits directly on the model object, not inside shardio. The public catalog's separate supports_reasoning flag describes separated thinking output, not the available controls. The price sheet at /v1/catalog/rates does not include thinking choices.
| Field | Meaning |
|---|
supported_efforts | The model's native enabled levels, when it has levels. A toggle-only model omits this field. |
default_effort | The default level, or none when a level-based model defaults to off. Omitted for toggle-only models. |
default_enabled | Whether thinking is on by default. |
mandatory | Whether thinking must stay on; if true, do not offer Off. |
An absent reasoning object means no declared thinking controls. Use the metadata rather than assuming every model supports the same efforts or starts at Medium. Models shows the current choices and defaults.
Output limits and structured responses
Chat and text completions accept max_completion_tokens as an alias of max_tokens. Send either name; if both are present, their values must agree, including whether they are null. A conflict is refused with 400 before a credit hold.
Chat completions accept response_format with type set to text, json_object or json_schema. For a JSON Schema, also supply json_schema with a name and a schema object; description and strict are optional. The schema reaches the engine unchanged.
Constrained formats use only serving recipes that support them, including on a retry or a spill to another recipe. If none can honour the requested format, the request is refused with response_format_unsupported before a credit hold. The model list reports supports_response_format under shardio; the model detail page lists it among supported parameters.
Token usage in responses
A chat or text completion reports usage with prompt_tokens, completion_tokens and total_tokens: the counts you are billed for. A streamed request gets the same object in one final chunk when it sends "stream_options": {"include_usage": true}.
completion_tokens includes thinking. When the model thought, usage.completion_tokens_details.reasoning_tokens gives the thinking share of it. It is already part of completion_tokens, not an extra charge, and it equals the thinking tokens shown for the request in your usage history. When the model did not think, completion_tokens_details is absent. On a model with a cache-read price, usage.prompt_tokens_details.cached_tokens gives the prompt tokens billed at that price.
Exporting request usage
GET /v1/usage?period=2026-10&limit=200 returns retained request metadata and costs for a UTC calendar month. period defaults to the current month. limit is from 1 to 200; pass a returned next_cursor as cursor to read the next page of the same month.
Any valid inference key may read the whole account's request history, including requests made with sibling or deleted keys. The export never includes another account, prompts or completions. It uses the ordinary request rate limit but does not reserve credit, so an account can export usage at a zero balance.
detail_from is the retention boundary. partial: true means the requested month starts before that boundary; this is not a complete billing statement. Use the account's statements and invoices for settled billing history. Invalid month, page limit and cursor values return 400 with invalid_period, invalid_limit and invalid_cursor, respectively.
Marketplace model document
GET /v1/marketplaces/openrouter/models returns the OpenRouter provider model schema, separate from the OpenAI-shaped /v1/models. Its output modality names the API the model actually serves: text, embeddings or decisions. A decision model does not advertise text generation, streaming, sampling parameters or tool calling; its charge is declared on its text input.
Request ids and per-request costs
Every response to a request that reaches a model carries an Inference-Id header with that request's id, such as req_4mZq8vN2xKpL. A streamed response sends it before the first chunk. It is the same id your usage export and Activity show, and a chat completion's id is the same value with a chatcmpl- prefix in place of req_.
POST /v1/billing/costs with {"requestIds": ["req_…", …]} returns {"requests": [{"requestId": "req_…", "costNanoUsd": 1234000}, …]}: the cost of each request your account made, in nano-USD (10⁻⁹ USD, so one cent is 10,000,000). Send up to 10,000 ids at a time. An id that is unknown, belongs to another account, is more than two days old or has not settled yet is left out, so ask again later; the same id always answers the same cost. Marketplaces that bill each request they route, such as Hugging Face, call it to learn what to charge. Like the usage export, it uses the ordinary request rate limit and needs no credit.
Prices in the model list
Each model in /v1/models carries context_length, the context window in tokens a request may use now (the same figure as shardio.context_limit), and pricing with input and output in US dollars per million tokens, the fields marketplaces read. The exact integer prices, in microdollars per million tokens, stay under shardio (price_in_micro_1m, price_out_micro_1m, price_cache_read_micro_1m); a model without an input price has no pricing object.