Skip to main content
Live. This area is documented as current, user-reliable behavior.

Goal

Let an app you run anywhere call Anthropic and OpenAI models with one StackShift key, a spending limit you choose and a list of every call.

Prerequisites

  • A StackShift account with a verified email address.
  • AI credits in your account, or your own Anthropic or OpenAI key.
  • For a team project: you are the team’s owner or an admin. Only the owner, who pays, can change who pays and the limits.

Workflow

1
Open the product switcher in the dashboard and choose AI, then New project. Give it a name, choose whether it belongs to you or a team, and choose who pays for calls: your AI credits with a monthly limit, or your own provider key.
2
Keep “Make a development key now” ticked. Copy the key when it is shown: you will not see it again. Store it on your server, for example as STACKSHIFT_AI_KEY, never in a website or mobile app.
3
In your app, keep the official SDK and change two things: the API key and the base URL. Use https://api.stackshift.cloud/ai for the Anthropic SDK and https://api.stackshift.cloud/ai/v1 for the OpenAI SDK.
4
Pass max_tokens (or max_output_tokens for the OpenAI Responses API) on every call.
5
When the app is ready to go live, open the project, choose Keys and make a production key. Only owners and team admins can make production keys.
6
Watch the project on the AI canvas: each project shows its calls a minute and how much of this month’s limit it has used. Requests lists every call with its model, tokens, credits, time taken and result.

Call a model

Use the official SDKs unchanged apart from the key and base URL. Streaming works the same way it does with the provider.

Development and production

Every project has a development and a production environment. Each has its own keys, its own choice of who pays for each provider, and an optional monthly limit lower than the project’s. Turning an environment off stops every key for it at once, and turning it back on does not bring those keys back. Archiving a project does the same for every key in the project.

Who pays and monthly limits

  • Your AI credits: calls use the same credits as Stackie and your agents. One credit is $0.001. The project limit, and any lower environment limit, stop calls once reached and start again on the 1st of the month (UTC).
  • Your own key: Anthropic or OpenAI bills your provider account directly and StackShift limits don’t cap it. The key is saved to the owner’s account, encrypted and never shown again; your agents and other features that use your own key share it.
  • You choose per environment and per provider, so production can use your own OpenAI key while development uses credits.
  • For a team project, calls on AI credits are paid by the team’s owner. If the team changes owner, the new owner confirms who pays before calls continue.

Keys

  • A key works in one environment. “Call models” keys can call models; “Only check who it is” keys can only confirm their project and environment at GET /api/v1/ai/identity.
  • Keys stop working after 90 days unless you choose 30, 180 or 365 days.
  • Developers on a project can make development keys. Only owners and team admins make production keys.
  • To swap a key, make the new one, put it in your app, then revoke the old one from the Keys tab.

People

Being on a team does not give access to its AI projects. Add people to a project by email as a developer, who can see spend and make development keys, or a viewer, who can see the project and its keys but not spend. For a team project, the person must be on the team.

Requests and spend

Requests lists every call from the last 30 days across your projects: when, project and environment, model, tokens in and out, credits, how long it took and the result. Prompts and replies are never stored. Billing › AI credits shows each AI project’s credits this month next to its limit, alongside Stackie and your agents.

From the CLI

Every dashboard action has a stackshift ai command. Bodies are JSON passed with --data.

HTTP API

The dashboard and CLI use /api/v1/ai, described in openapi/ai-v1.openapi.json. Personal tokens need the ai:read or ai:manage scope; a wildcard token alone is not enough. Lists take limit (1 to 100) and after; pass next_cursor as after for the next page. Agents connected to your account can read a project’s keys, limits, who pays, spend and calls. They cannot make keys, change limits, change who pays or add people.

Expected result

Your app calls models through StackShift with its own key. Each call is counted against the environment and project limits and listed under Requests for 30 days.

Common failures

  • 402 budget_reached: the environment or the project used its monthly limit, or your account is out of AI credits. Raise the limit under Who pays, or wait for the 1st of the month (UTC). Nothing is charged past a limit.
  • 402 funding_required: nobody pays for that provider in this environment yet. Open Who pays and choose your AI credits or your own key for it.
  • 401 provider_key_refused: your own Anthropic or OpenAI key was refused by the provider. Replace it under Who pays.
  • 401 unauthorized: the key was revoked, has expired, belongs to an archived project or a turned-off environment, or was made with “Only check who it is”.
  • 403 model_not_allowed: that model isn’t available through StackShift.
  • 413 request_too_large: the request is over 4 MB.
  • 503 provider_unavailable or broker_unavailable with retry-after: try again shortly. The official SDKs retry with backoff. StackShift never switches you to another provider or model.
  • ai_unavailable from the dashboard or API: AI projects need a verified email address. Verify yours from your profile.

Model access for agents

Your agent calls Anthropic or OpenAI through StackShift with a short-lived token. No provider key is ever in the agent.

Run your agent on StackShift

Deploy an agent next to your apps and databases. It gets an address, a level, a budget and a record of everything it does, and it sleeps when there is nothing to do.