Messages
https://api.steerwise.s3techpulse.com/v1/messagesAnthropic’s Messages API, for the Anthropic SDKs and Claude Code. It serves Claude models only, and "model": "auto" picks only among them. Needs a key with the inference scope.
Example
curl https://api.steerwise.s3techpulse.com/v1/messages \
-H "x-api-key: $STEERWISE_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"max_tokens": 1024,
"messages": [
{ "role": "user", "content": "Say hello in one short sentence." }
]
}' import os
import anthropic
client = anthropic.Anthropic(
base_url="https://api.steerwise.s3techpulse.com",
api_key=os.environ["STEERWISE_API_KEY"],
)
msg = client.messages.create(
model="auto",
max_tokens=1024,
messages=[{"role": "user", "content": "Say hello in one short sentence."}],
)
print(msg.model, msg.content[0].text)import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://api.steerwise.s3techpulse.com",
apiKey: process.env.STEERWISE_API_KEY,
});
const msg = await client.messages.create({
model: "auto",
max_tokens: 1024,
messages: [{ role: "user", content: "Say hello in one short sentence." }],
});
console.log(msg.model, msg.content);The Python and Node samples use Anthropic’s SDKs, with the host as the base URL (no /v1).
{
"id": "msg_<id>",
"type": "message",
"role": "assistant",
"model": "<the Claude model that served the call>",
"content": [ { "type": "text", "text": "<the reply>" } ],
"stop_reason": "end_turn",
"usage": { "input_tokens": <n>, "output_tokens": <n> }
}Request headers
anthropic-version:2023-06-01(the default when absent) or2026-10-21. Any other version is refused.anthropic-beta: forwarded, except the refused values below.- The key goes in
x-api-keyorAuthorization: Bearer.
Request body
modelstringRequiredauto, or a Claude model id fromGET /v1/models.max_tokensintegerRequiredThe output limit. It is reserved in full against your limits and wallet until the call ends, then what was not used is returned.
messagesarrayRequiredAnthropic’s messages, forwarded as sent.
systemstring or arrayThe system prompt. Steerwise adds a short per-organisation block to it, so prompt caches are never shared across organisations.
toolsarrayAnthropic tools. Server tools with per-use fees are refused (see below).
streambooleanAnthropic’s event stream, frame for frame.
metadataobjectuser_idis replaced by an opaque hash of your organisation and the value sent.speedstringOnly
standard.inference_geostringOnly
global.service_tierstringOnly
autoorstandard_only.
Every field not listed here is forwarded as sent, unknown fields and block types included. Steerwise changes only this:
modelbecomes the model that serves the call.- A short per-organisation block is added to
system; acache_controlon a tool moves to that block. - A
cache_control.ttlother than5mis removed: caching lasts 5 minutes. Cache reads and writes are billed at the model’s cache prices. - Thinking blocks are returned and accepted back as they are.
Refused
Refused with 400 invalid_request_error, worded as Anthropic words the same refusal, so Claude Code carries on without the feature:
thread,diagnostics,container,mcp_serversand file sources (source.type: file).- Server tools with per-use fees:
web_search_*,code_execution_*,advisor_*. anthropic-betavaluesfiles-api-*,skills-*,code-execution-*,mcp-client-*andfast-mode-*.oauth-*values are dropped silently.
Routing
There is no fallback to another model on this endpoint. With auto the model is picked as on the other endpoints, but the call stays on its pick: it does not move up a tier on a refusal.
Response
Anthropic’s Message, as the model produced it, with model set to the model that served the call. Response headers: x-request-id (also as request-id), x-steerwise-routed-from, x-steerwise-run and the rate limit headers.
With "stream": true only : ping comment lines are sent while the model starts; message_start then names the served model. An error after the stream opened arrives as event: error and the stream ends.
Count tokens
https://api.steerwise.s3techpulse.com/v1/messages/count_tokensAnthropic’s token count for a Messages body (without max_tokens), with the same changes and refusals as POST /v1/messages. The count includes the per-organisation system block, because those tokens are sent and billed.
- Counting is not billed and does not use your rate limits. It has its own allowance of 120 calls per minute per key (429
rate_limit_exceededwithretry-after). - The response is
{"input_tokens": <n>}.
Errors
Errors use Anthropic’s shape, so the Anthropic SDKs and Claude Code handle them as usual. The Steerwise code is in error.details.error_code. A rejection of the request by the model itself (400, 413, 422) is forwarded with its own status and body. retry-after is in whole seconds, and 5xx answers carry x-should-retry: true.
{
"type": "error",
"error": {
"type": "billing_error",
"message": "<what happened>",
"details": { "error_code": "spend_cap_reached" }
},
"request_id": "<x-request-id>"
}| Status | error.type | error_code | When |
|---|---|---|---|
| 400 | invalid_request_error | invalid_request | The body is malformed, a field is missing or invalid, a feature is refused (above), or the model is not available here. When the model itself rejects the request, its own status (400, 413 or 422) and body are forwarded, with no error_code. |
| 400 | invalid_request_error | context_length_exceeded | The prompt is over your plan’s or key’s context limit. |
| 401 | authentication_error | missing_api_key | No key was sent. |
| 401 | authentication_error | invalid_api_key | The key is malformed, unknown, revoked or expired. |
| 402 | billing_error | insufficient_balance | The wallet balance is too low for this request. |
| 402 | billing_error | spend_cap_reached | Spend has reached a daily or monthly cap of the key or the organisation, or the agent run’s cap. |
| 402 | billing_error | request_cost_cap_exceeded | This request’s worst case (the model, the prompt and the full output limit) is over the per-request cap. |
| 403 | permission_error | account_suspended | The organisation or user is suspended. |
| 403 | permission_error | wallet_frozen | Staff have put the organisation’s wallet on hold. |
| 403 | permission_error | key_paused | The key is paused, usually by the runaway-spend detector after its spend jumped far past its usual rate. |
| 403 | permission_error | missing_scope | The key lacks the scope this endpoint needs. |
| 403 | permission_error | model_not_allowed | Your plan does not include the model. |
| 403 | permission_error | model_not_allowed_for_key | The key’s allowed models exclude this model. |
| 404 | not_found_error | model_not_found | No active model has that id. |
| 413 | request_too_large | request_too_large | The body is over 32 MiB, or the model rejected the request as too large. |
| 429 | rate_limit_error | rate_limit_exceeded | A per-minute request or token limit, or the limit on calls at once, of the organisation, user, key or model. |
| 429 | rate_limit_error | insufficient_quota | The monthly token quota cannot cover this call’s reservation. |
| 429 | rate_limit_error | spend_cap_pending | Calls still in flight could reach a spend cap. |
| 429 | rate_limit_error | upstream_overloaded | The model is rate limited after retries. |
| 500 | api_error | internal_error | Something failed on our side. Details are logged under the request id, never returned. |
| 502 | api_error | upstream_error | The model failed after retries, or a non-streaming call failed after the model had started its answer. |
| 503 | api_error | upstream_overloaded | Steerwise is holding back calls to the model for a short while. |
| 503 | api_error | wallet_unavailable | The balance check could not run, so the request was not started. |
| 503 | api_error | limits_unavailable | The rate-limit check could not run, so the request was not started. |
| 503 | api_error | server_overloaded | The server is at its limit of requests at once. |
| 503 | api_error | service_unavailable | The key could not be checked in time. With x-should-retry: false and no Retry-After: no model that could serve the call is available right now. |
| 503 | api_error | service_restarting | The server is restarting and cancelled the request. |
| 504 | timeout_error | upstream_timeout | The model did not respond in time. |
| 529 | overloaded_error | upstream_overloaded | The model is overloaded or unavailable after retries. |
What to do about each one: Errors and limits.
Every field and schema: Full API reference.