AI Stupid Level
API docs

Support

API documentation

Complete developer reference for the AI Smart Router. Requests go to https://aistupidlevel.info/v1 with your aism_ key as a Bearer token.

Base URL
https://aistupidlevel.info/v1
Auth
Bearer aism_key
Format
OpenAI-compatible
Providers
6 (OpenAI, Anthropic, …)

API overview

Introduction

The AI Smart Router provides an OpenAI-compatible API that intelligently routes your requests to the best AI model for the job, based on benchmarks that re-run on a fixed schedule (coding every four hours, reasoning and tool use daily). Use a single aism_ key — your SR (Smart Router) key — to access models from 6 providers: OpenAI, Anthropic, Google (Gemini), DeepSeek, Kimi (Moonshot), and GLM (Z.AI).

Base URL

https://aistupidlevel.info/v1

Authentication

All requests require a Bearer token in the Authorization header:

Authorization: Bearer aism_your_api_key_here

Some tools enforce an sk- prefix for API keys. The router accepts sk-aism_... — the prefix is stripped automatically.

Project keys. A key made on a workspace project’s page works the same way, but follows the project’s routing rules (strategy, allowed models, limits), pays with the project’s or workspace’s provider keys, and counts against the project’s budget and the holder’s cap in it — see the workspace guide. Keys can also expire; an expired key gets a 401 saying when it expired.

Endpoints

MethodPathDescription
POST/v1/chat/completionsChat completions (auto-routing or direct pin)
GET/v1/modelsList available models (requires auth)
POST/v1/embeddingsEmbeddings (proxied to OpenAI)
POST/v1/messagesNative Anthropic Messages API passthrough (Claude Code)
POST/v1/messages/count_tokensAnthropic token counter (free; not counted against your plan)
POST/v1/router/feedbackRate an answer up or down by its completion id
POST/v1/route/previewThe model, fallbacks and reasons a chat request would get, without sending it
GET/v1/usageThis month's requests, prepaid credits and the key's budget
GET/v1/openapi.jsonOpenAPI 3.1 description of the router API (no key needed)
POST/v1/explainWhich model “auto” would pick for a prompt, without sending it
POST/v1/compareWhat every strategy would pick for a prompt
POST/v1/analyzeHow the router classifies a prompt

SDKs

Official clients for TypeScript and Python, and a provider for the Vercel AI SDK. Any OpenAI client works too (see Integrations); the SDKs add what an OpenAI client cannot see.

@aistupidlevel/router
TypeScript and JavaScript, Node 18+, ESM and CommonJS. No dependencies: it uses the built-in fetch
aistupidlevel
Python 3.9+, sync and asyncio clients. Depends only on httpx
@aistupidlevel/ai-sdk-provider
Provider for the Vercel AI SDK (generateText, streamText, tools)
// npm install @aistupidlevel/router
import { ASLRouter } from '@aistupidlevel/router';

const router = new ASLRouter(); // reads ASL_ROUTER_KEY

const r = await router.chat.completions.create({
  model: 'auto-coding',
  messages: [{ role: 'user', content: 'Fix the off-by-one in this loop: ...' }],
});
console.log(r.choices[0].message.content);
console.log(r.routing.model, r.routing.reasoning); // which model answered, and why

// Streaming
const stream = await router.chat.completions.create({ model: 'auto-best', messages, stream: true });
for await (const text of stream.textStream()) process.stdout.write(text);

What the SDKs add

Routing on every answer. routing carries the provider and model that answered, why they were chosen, the latency, the request id, and whether a fallback answered (routing.fallback). For a stream it is known before any chunk arrives.

Safe retries. Connection failures, timeouts, 408, 409, 429 and 5xx are retried twice by default with backoff, honouring Retry-After. Every non-streaming request carries an Idempotency-Key, so a retry of a request whose answer was lost is never charged twice. Errors that retrying cannot fix (allowance used up, a budget reached, a provider key refused) are not retried.

Errors that say whose problem it is. Each error class has a party (request, account, provider_key, provider, router or network) and a retryable flag, so an app can tell its user to top up, to fix a provider key, or simply to try again.

Tool loops. chat.runTools (Python: chat.run_tools) runs a tool-calling conversation to its final answer: it calls your handlers, sends their results back, and reports a handler's exception to the model instead of crashing. The loop stays on one model throughout.

const { completion, rounds } = await router.chat.runTools(
  { model: 'auto-tooling', messages, tools },
  { handlers: { get_weather: async ({ city }) => ({ city, temp: 7 }) } },
);

The API is also described in OpenAPI 3.1 at /v1/openapi.json, for generating a client in any other language. Source: github.com/StudioPlatforms/aistupidlevel-sdk.

POST/v1/chat/completions

Create a chat completion. Use an auto-* virtual model for intelligent routing, or a real model ID for direct pin routing.

Request body

JSON
{
  "model": "auto-coding",
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Write a Python fibonacci function"}
  ],
  "temperature": 0.7,
  "max_tokens": 1000,
  "stream": false
}

Parameters

ParameterTypeRequiredDescription
modelstringYes"auto-coding", "auto-reasoning", or any real model ID that GET /v1/models lists
messagesarrayYesArray of {role, content} message objects
temperaturenumberNoSampling temperature (0-2). Default varies by provider.
max_tokensnumberNoMax tokens to generate. For reasoning models use max_completion_tokens.
max_completion_tokensnumberNoMax output tokens including reasoning tokens (OpenAI reasoning models).
streambooleanNoEnable SSE streaming. Default: false.
stream_optionsobjectNo{ include_usage: true } — emit final usage chunk in SSE.
toolsarrayNoFunction tool definitions for tool calling.
tool_choicestring|objectNo"auto", "none", "required", or {type:"function", function:{name}}.
response_formatobjectNo{ type: "json_object" } or { type: "json_schema", json_schema: {...} }.
reasoning_effortstringNo"none"|"minimal"|"low"|"medium"|"high"|"xhigh"|"max". Any value works with any model: the router maps it to the nearest level the chosen model supports (a tie goes to the deeper level).
top_pnumberNoNucleus sampling. Default: 1.
frequency_penaltynumberNoFrequency penalty (-2 to 2). Not supported by all providers.
presence_penaltynumberNoPresence penalty (-2 to 2). Not supported by all providers.
stopstring|arrayNoStop sequences. Not supported by all providers.
seednumberNoRandom seed for reproducibility.

Code examples

from openai import OpenAI

client = OpenAI(
    api_key="aism_your_key_here",
    base_url="https://aistupidlevel.info/v1"
)

response = client.chat.completions.create(
    model="auto-coding",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)

Response

JSON
{
  "id": "chatcmpl-1748250000000",
  "object": "chat.completion",
  "created": 1748250000,
  "model": "<the model that answered>",
  "system_fingerprint": "aism_v1_<provider>",
  "service_tier": "default",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Hello! How can I help you today?",
      "refusal": null,
      "annotations": []
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 9,
    "total_tokens": 21,
    "prompt_tokens_details": { "cached_tokens": 0 },
    "completion_tokens_details": { "reasoning_tokens": 0 }
  }
}

Response headers

X-AISM-Provider
The provider that answered
X-AISM-Model
The model that answered
X-AISM-Reasoning
Why it was chosen, including any fallback
X-AISM-Latency
How long the request took
X-AISM-Request-Id
The completion id, for feedback
X-AISM-Streaming-Mode
native when streamed text arrives as the model writes it; buffered for a streamed forced tool call, which is checked before anything is sent — see Tools, JSON and streaming

Virtual models (routing strategies)

Use these as the model parameter for intelligent routing.

Model IDStrategyDescription
autoDefaultUses your saved routing strategy from Preferences
auto-taskPer requestReads each request and picks the matching benchmark: tools → tool use, design or long sessions → reasoning, code → coding, else overall; simple requests use the Best value version. The routing reason names the rule
auto-splitYour splitYour own weighted traffic split across models you choose (set it in Preferences); the rest of the split goes ahead of your fallback order
auto-codingCodingBest for code generation, debugging, refactoring
auto-reasoningReasoningBest for complex analysis, math, logic
auto-consistentConsistencyAmong models within 5 points of the best one you can use, the one whose score swings least from run to run
auto-fastest-qualitySpeedAmong models within 5 points of the best one you can use, the fastest (measured latency) — auto-fastest has no quality bar
auto-creativeLegacyStill accepted and routed as auto-best — there is no creative-writing benchmark
auto-cheapestCostLowest list price per token among your providers — no quality bar
auto-valueValueMost combined-score points per measured dollar, among models within 5 points of the best one you can use
auto-value-codingValueMost coding points per dollar (measured cost of a coding run), near-top models only
auto-value-reasoningValueMost reasoning points per dollar (measured cost of a reasoning run), near-top models only
auto-value-toolingValueMost tool-use points per dollar (measured cost of a tool-use run), near-top models only
auto-value-agenticValueAlias for auto-value-tooling
auto-fastestSpeedLowest latency response time
auto-toolingTool useBest at calling tools correctly — scored on our tool-calling suite
auto-agenticTool useAlias for auto-tooling; "agentic" is what most tools call it
auto-bestOverallBest combined score regardless of category; among statistically tied leaders, your tie-break decides (the cheaper by default)

Direct pin routing: Send any real model ID (GET /v1/models lists them all) to bypass the strategy router and forward directly to that provider.

How the best model is chosen: every model ranks on the average of its last five scored benchmark runs, never on a single run. When the leaders are closer than the test can tell apart (within 1.96 times their combined standard error, the same test as the leaderboard's = ranks), they are tied, and your tie-break in Preferences picks among them: the one that cost least per task in our runs (the default), the fastest, or the highest score. A model you were already routed to stays while it is still tied, and a conversation stays on the model that answered it, so the pick does not change with every new run. Unknown auto-* names are a 400 model_not_found that lists the valid ones.

Near-top strategies (auto-value*, auto-consistent, auto-fastest-quality) only choose among models within 5 points of the best model you can use — after your keys, exclusions and limits — so a cheaper, steadier or faster pick is never a much weaker one. Value is per run: the benchmark score divided by what one identical benchmark run cost that model, not its list price per token.

Drift-aware routing (on by default, see Preferences): a model whose drift detector has fired for the skill your strategy relies on, or whose hourly canary is failing, is moved behind every unflagged model. It is never removed — if every candidate is flagged, the best of them is still used — and the routing reason names any model that was passed over and why.

GET/v1/models

List available models. Returns virtual auto-* models plus all real models that have been benchmarked. Requires authentication.

cURL
curl https://aistupidlevel.info/v1/models \
  -H "Authorization: Bearer aism_your_key_here"

Tools like Roo Code, Continue, Open WebUI, and LibreChat call this endpoint to populate their model dropdowns.

Tools, JSON and streaming

Tool calling works end to end. Send OpenAI-format tools; the response carries tool_calls with the provider's own ids. Send the results back as role: "tool" messages with tool_call_id, exactly as with OpenAI. The router remembers each model's own turn for 24 hours (Claude's thinking blocks, OpenAI reasoning items, Gemini thought signatures), so multi-step agent loops keep working, and a conversation stays on the model that started it.

Prompt caching is on. Agent loops resend the whole conversation every turn, and every provider can serve the part it has seen from its prompt cache at a fraction of the input price. OpenAI, Gemini, DeepSeek, Kimi and GLM do it automatically; for Claude, which caches only when asked, the router asks for every conversation that continues (one with tools, or with an answer in it already). Cached tokens are reported in usage.prompt_tokens_details.cached_tokens and costed at the cache rate in Monitoring and budgets.

Refusals: when a model declines a request, the answer comes back with message.refusal and finish_reason: "content_filter", and it is not counted against your allowance. The Claude models that support it first retry on Anthropic's own fallback model in the same call. A refused request is not sent to other providers.

tool_choice: auto and none work everywhere, and required or a named function works on every model. OpenAI, Gemini and most DeepSeek, Kimi and Claude models enforce it natively (DeepSeek switches thinking off for that one request), and routed requests that force a tool go to those first. Models whose APIs cannot be forced (GLM, and some Kimi and Claude models; GLM even accepts the setting and ignores it) get an instruction for that turn instead: the router checks that the answer really is the tool call, retries once, and otherwise falls back or answers 502 tool_choice_not_honoured. It never hands you prose when you forced a tool. Streamed forced calls arrive in one piece (X-AISM-Streaming-Mode: buffered), because the answer is checked before anything is sent.

JSON output: response_format json_object and json_schema are supported for every provider. The schema is enforced natively by OpenAI, Gemini and the Claude models that support structured output (when every object sets additionalProperties: false); DeepSeek, Kimi and GLM receive the schema as an instruction in JSON mode.

Streaming (stream: true) is real: text arrives as the model writes it (X-AISM-Streaming-Mode: native). Tool calls arrive in one chunk each once the model has finished them, then the finish reason, then usage if you set stream_options.include_usage. If the chosen model fails before sending anything, or its provider sends nothing at all for 120 seconds, the next fallback is tried; once bytes have been sent, a failure ends the stream with an error event.

Text only, by design. The router picks a model from our benchmark results for coding, reasoning and tool use; none of those measure image, audio or file understanding, so a request with them gets a 400 unsupported_content rather than a routing decision we cannot back. n must be 1. Requests can be up to 32 MB — about a million tokens of code in context.

Rate a response

Ratings help routing learn from real use:

cURL
curl -X POST https://aistupidlevel.info/v1/router/feedback \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer aism_your_key_here" \
  -d '{"id": "chatcmpl-...", "rating": "up"}'

Use the id from the completion (also in X-AISM-Request-Id); rating is "up"/1 or "down"/-1. Ratings nudge rankings only slightly, and only once enough have accumulated.

Sandbox and preview

Build and test against the router without provider keys, without spending anything, and without using your allowance.

Sandbox

Send X-ASL-Sandbox: true and the request goes through the real pipeline (authentication, validation, your preferences, the live ranking and fallback chain) but no provider is called. The answer is a deterministic mock in exactly the shape of a real one: the same headers, streaming chunks, tool calls with arguments that fit your schema, JSON that fits your response_format, and usage. It carries X-AISM-Sandbox: true, needs no provider key (routing runs as if you had one for every provider), and counts against no allowance or budget.

curl https://aistupidlevel.info/v1/chat/completions \
  -H "Authorization: Bearer aism_your_key_here" \
  -H "Content-Type: application/json" \
  -H "X-ASL-Sandbox: true" \
  -d '{"model": "auto-coding", "messages": [{"role": "user", "content": "Hello!"}]}'

X-ASL-Sandbox-Simulate makes a sandbox request fail the way a real one can, so your error handling can be tested: rate_limited, allowance_exhausted, insufficient_quota, provider_key_rejected, model_unavailable, server_error, or fallback (the primary fails and the next model answers, as shown in X-AISM-Reasoning).

POST/v1/route/preview

Takes the same body as a chat request and returns the routing decision it would get (strategy, model, fallbacks, scores and the reasons) without sending it. Nothing is called or counted. With your real keys it shows what your request will do; with X-ASL-Sandbox: true it shows what a sandbox request would route to.

cURL
curl https://aistupidlevel.info/v1/route/preview \
  -H "Authorization: Bearer aism_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"model": "auto-coding", "messages": [{"role": "user", "content": "Fix this bug"}]}'
JSON
{
  "object": "route.preview",
  "requested_model": "auto-coding",
  "strategy": "best_coding",
  "sandbox": false,
  "primary": {
    "model": "<model id>",
    "provider": "<provider>",
    "score": 99,
    "reasoning": "Selected <model id> from <provider> for best coding performance ...",
    "estimated_cost_usd": 0.012
  },
  "fallbacks": [
    { "model": "<model id>", "provider": "<another provider>", "score": 96, "reasoning": "Fallback: ...", "estimated_cost_usd": 0.012 }
  ],
  "fallback_enabled": true
}

GET/v1/usage

This month's requests used and included in your plan, your prepaid credits, whether a request would be accepted now, and this key's monthly budget and spend. Free, and not counted.

cURL
curl https://aistupidlevel.info/v1/usage \
  -H "Authorization: Bearer aism_your_key_here"

Retries and idempotency

Send Idempotency-Key (any unique string up to 255 characters) on POST /v1/chat/completions and you can safely retry a request whose response you never received. For 24 hours, the same key from the same account returns the stored response instead of routing again, marked Idempotent-Replayed: true, and is not counted again. The SDKs send one on every non-streaming request.

cURL
curl https://aistupidlevel.info/v1/chat/completions \
  -H "Authorization: Bearer aism_your_key_here" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-4821-summary" \
  -d '{"model": "auto", "messages": [{"role": "user", "content": "Summarise order 4821"}]}'

Only final answers are kept. A 5xx or a 429 is not stored, so retrying after a failure or a rate limit is a real new attempt. Reusing a key with a different body gets 422 idempotency_key_reused; a retry that arrives while the original attempt is still running gets 409 idempotency_in_progress with Retry-After. Streams cannot be replayed, so streaming requests ignore the header.

x-should-retry. Error responses that retrying cannot fix (allowance_exhausted, insufficient_quota, provider_quota_exceeded) carry x-should-retry: false, which the official OpenAI SDKs and ours obey, so a client does not retry them in a loop.

POST/v1/embeddings

Generate embeddings via OpenAI's embedding models. Required by Continue, LibreChat, Open WebUI, and AnythingLLM for RAG features.

cURL
curl -X POST https://aistupidlevel.info/v1/embeddings \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer aism_your_key_here" \
  -d '{"model": "text-embedding-3-small", "input": "Hello world"}'

Requires an active OpenAI provider key. Supported models: text-embedding-3-small (also auto-embedding), text-embedding-3-large. Each call counts as one request against your plan, and per-key budgets apply.

POST/v1/messagesAnthropic

Native Anthropic Messages API passthrough. Unlocks Claude Code, Cline's Anthropic provider, Roo Code's Anthropic provider, and TypingMind's Anthropic preset.

Accepts aism_ keys via either x-api-key or Authorization: Bearer header. Forwards the anthropic-version header (defaults to 2023-06-01) and any anthropic-beta header as sent. POST /v1/messages/count_tokens is passed through too; it is free at Anthropic, so it is not counted against your plan.

Claude Code

Shell
export ANTHROPIC_BASE_URL="https://aistupidlevel.info"
export ANTHROPIC_API_KEY="aism_your_key_here"
claude

There is no routing on this path: the request goes to Anthropic, with your Anthropic key, for the Claude model it names. Your plan allowance, budgets and request logs apply as on the other endpoints.

cURL
curl -X POST https://aistupidlevel.info/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: aism_your_key_here" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "<a Claude model id>",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Requires an active Anthropic provider key. Returns native Anthropic response format (not OpenAI-translated).

Error handling

HTTP codeerror.typeerror.codeDescription
400invalid_request_errorinvalid_messagesinvalid_toolsunsupported_contentmodel_not_foundThe request cannot be routed as sent (the message says what to change)
400invalid_request_errorprovider_rejected_requestThe provider rejected the request itself; its own words are in the message
400invalid_request_errorprovider_key_rejectedno_provider_keysYour provider key is missing or was refused — add or update it in Providers
400invalid_request_errorno_routable_modelYour preferences exclude every model (the message names the setting)
401authentication_errorinvalid_api_keyMissing or invalid aism_ key
401authentication_errorexpired_api_keyThe key had an expiry date and it has passed (the message says when)
400invalid_request_errorpinning_not_allowedmodel_not_allowedprovider_not_allowedProject keys: the project routes every request, or does not allow that model or provider
403permission_errornot_in_workspacenot_in_projectseat_requiredproject_deletedplan_lapsedProject keys: the holder left, lost their seat, or the project or its plan is gone
429rate_limit_errorrate_limitedProject keys: the project’s requests-per-minute limit for this key (see Retry-After)
429rate_limit_errorproject_budget_exceededProject keys: the request could take the project past its monthly budget
429rate_limit_errormember_cap_reachedProject keys: you reached your monthly cap in the project
429rate_limit_errorbudget_downgradedProject keys: the budget is spent and the project now routes only (cheapest models); naming a model is refused
429rate_limit_errorallowance_exhaustedThis month's requests are used up and you have no prepaid credits
429rate_limit_errorinsufficient_quotaThis key's monthly hard budget would be exceeded
429rate_limit_errorprovider_quota_exceededYour provider account refused for credit or quota
429rate_limit_errorprovider_rate_limitedYour provider key is being rate-limited on every model tried (see Retry-After). Other models and providers are tried first
400invalid_request_errorinvalid_idempotency_keyIdempotency-Key must be 1–255 printable ASCII characters
422invalid_request_erroridempotency_key_reusedThe Idempotency-Key was already used with a different request body
409conflict_erroridempotency_in_progressA request with this Idempotency-Key is still running (see Retry-After)
413nonenoneThe request body is over 32 MB; the response is a plain message with no error object
502api_errormodel_unavailableEvery model tried failed on the provider side
502api_errortool_choice_not_honouredYou forced a tool call and the model answered without one, twice (only models that cannot be forced natively; see Tools above)
500server_errorinternal_errorInternal server error
JSON
{
  "error": {
    "message": "Invalid API key. Generate a new key at https://aistupidlevel.info/router/keys",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}

SDKs use error.type and error.code for retry decisions. These match the OpenAI standard.

Integrations

The router is an OpenAI-compatible endpoint, so any tool that lets you set a base URL works with it. Below are the ready-made integrations, then the settings for the tools people use most.

Built in

n8n-nodes-aistupidlevel
n8n. A node for chat, routing and benchmark data, plus an AI Stupid Level Chat Model for the AI Agent. Verified on n8n Cloud, where you add it from the canvas; on self-hosted n8n, install it from Settings → Community Nodes
@aistupidlevel/mcp
MCP server, listed in the official MCP Registry. Rankings, drift, incidents, route previews and router answers as tools in Claude, Cursor, VS Code and any MCP client
langchain-aistupidlevel
LangChain chat model ChatAISL: tools, structured output and streaming, plus the model that answered and why
@aistupidlevel/ai-sdk-provider
Vercel AI SDK provider: generateText, streamText and tools
@aistupidlevel/dsh-provider
DeepSeek Harness plugin bundle: adds AI Stupid Level as a provider route with the routing modes as models
@aistupidlevel/openclaw-provider
OpenClaw provider plugin on ClawHub: the routing modes as OpenClaw models, with a live model list
aistupidlevel
Hermes Agent provider plugin in the official Hermes plugin catalog: hermes plugins install aistupidlevel
AI Stupid Level
Dify model provider plugin on the Dify Marketplace, with the routing modes as models
AI Stupid Level
RAGFlow model provider: pick it under Model providers and paste your router key
@aistupidlevel/pi-provider
Pi provider extension: the routing modes as Pi models, with the model that answered in the footer. pi install npm:@aistupidlevel/pi-provider
lfx-aistupidlevel
Langflow model provider and component: AI Stupid Level in the Language Model and Agent pickers. pip install lfx-aistupidlevel, then restart Langflow
AI Stupid Level
Open WebUI Function on openwebui.com: every routing mode as a model, with the model that answered and why above each reply

Use your router key (aism_…) wherever a tool asks for an API key, and a routing mode such as auto-coding as the model (see Virtual models). The MCP server and the n8n benchmark operations also take a Data API key (asl_live_…), from Data API keys.

CC Switch

If you use CC Switch, one click adds AI Stupid Level to one of these apps with auto-coding as the model, and CC Switch asks for your router key. A key you create on the Keys page comes with the same buttons, with the key already filled in.

Apps and agents

Install:
  n8n Cloud     search "AI Stupid Level" on the canvas (a verified node;
                Verified Community Nodes must be on in the Admin Panel)
  Self-hosted   Settings → Community Nodes → Install → n8n-nodes-aistupidlevel

Credentials:
  AI Stupid Level Router API   router key (aism_…)      chat and routing
  AI Stupid Level Data API     Data API key (asl_live_…) rankings, drift, incidents

Nodes:
  AI Stupid Level              Chat · Router (preview, usage) · Benchmark data
  AI Stupid Level Chat Model   plug into an AI Agent or LLM chain; every call,
                               tool turns included, goes through the router

In code

from openai import OpenAI

client = OpenAI(api_key="aism_your_key_here", base_url="https://aistupidlevel.info/v1")

raw = client.chat.completions.with_raw_response.create(
    model="auto-coding", messages=[{"role": "user", "content": "Hello!"}]
)
print(raw.headers["x-aism-model"])   # the model that answered
print(raw.parse().choices[0].message.content)

Questions? Check the Help center