AI router
Put your AI bill on cloud credits.
Point the OpenAI SDK at Tokensaver. Each request is checked, sent to a model your credits cover, and counted.
Your app
model="assistant"Key within budget
Main API key, 74% usedAlias allows the model
ClaudeCredits cover it
AWS ActivateCloud is up
AWS Bedrock is up
Routed to
AWS Bedrock
- Paid by
- AWS Activate
- Cash
- $0.00
On a 429 from AWS Bedrock
Amazon Nova on AWS Bedrock
Sample request. AWS Bedrock first; Vertex AI and Azure AI Foundry next.
Three lines change. So does who pays.
Keep the OpenAI SDK: chat completions, streamed or not, and /v1/models.
added line: base_url="https://api.tokensaver.io/v1", (note 1)removed line: api_key=os.environ["OPENAI_API_KEY"],added line: api_key=os.environ["TOKENSAVER_API_KEY"], (note 2)removed line: model="your-current-model",added line: model="assistant", (note 3)import osfrom openai import OpenAI client = OpenAI(added line: base_url="https://api.tokensaver.io/v1", (note 1)removed line: api_key=os.environ["OPENAI_API_KEY"],added line: api_key=os.environ["TOKENSAVER_API_KEY"], (note 2)) response = client.chat.completions.create(removed line: model="your-current-model",added line: model="assistant", (note 3) messages=[{"role": "user", "content": "Hello"}],)print(response.choices[0].message.content)Who pays for this call
- Before
- your-current-model
- Paid by
- Cash
- After
- assistant
- Paid by
- AWS Activate
- Cash
- $0.00
- Send requests to Tokensaver.
- One key for the clouds you connect.
- An alias named after what your app does.
When a cloud says no
The request moves to the next model your alias allows, before your app sees a byte.
Claude on AWS Bedrock
assistant · attempt 1
Amazon Nova on AWS Bedrock
assistant · attempt 2
Claude answered 429 at 140 ms; Amazon Nova sent the first byte at 610 ms.
- Before the first byte: the router may switch
- After it: the answer streams as it is
On a 429, a 5xx or a timeout
Throttling, server errors and slow answers move the request on.
Only to a model with the same features
A request that needs tools or images goes to a model that has them.
Only inside your own aliases
An alias reaches the models you allowed it, and no others.
Never halfway through an answer
Once the first byte reaches your app, the answer streams as it is.
A key that reaches its budget stops.
Budgets per key and per organization stop requests at the limit you set. Every request is counted by key, model and payer.
Batch jobs
Nightly evaluation runs
This month
$1,000 of $1,000
Budget reached- extraction · Llama200$0.0021
- extraction · Llama200$0.0019
- extractionRefused · budget reached$0.0000
Budgets work per key and per organization.
Spend by model
Last 30 days
- Paid by AWS Activate
- Paid in cash
- Claude · AWS Bedrock$3,180
- Amazon Nova · AWS Bedrock$1,240
- Llama · AWS Bedrock$560
- Mistral · AWS Bedrock$320
- Paid by AWS Activate
- $5,300
- Cash
- $0.00
Your AWS account runs every request.
How we handle your data- Your account
- Requests run in your own AWS account.
- No prompt logs
- Prompts and responses are not logged by default.
Questions about the router
Which models can I use?
Models on Amazon Bedrock that your AWS account can call, such as Amazon Nova, Llama, Mistral and Claude. Claude needs a one-time access request in your AWS account. Gemini on Vertex AI and GPT models in Azure AI Foundry come next.
Do I need to change my code?
Three lines in the OpenAI SDK: the base URL, the key, and the model, which becomes an alias such as assistant.
What happens when a cloud fails?
On a 429, a 5xx or a timeout, the request moves to the next model your alias allows, with the same features, before your app sees a byte.
Do you see my prompts?
Prompts and responses are not logged by default, and requests run in your own AWS account.
What does it cost?
Prices are on the Pricing page.
Put your credits to work.
One API key for the models your credits cover, with a budget on every key.
