Skip to navigation
Start here

Authentication

Use test keys for the monthly test tokens and production keys for purchased credits.

Every route under /v1 needs an API key. Send it as a bearer token:

Authorization: Bearer test_sk-...

Two routes stay public: the service root / and the spec at /openapi.json.

Get a key

Create keys in the developer console at console.milliseconds.ai.

1

Sign up

Create an account at console.milliseconds.ai/signup, then name your organization.

2

Get your test key

Setup creates a reusable test key named Playground. Open API keys to show or copy it, or create another test key.

3

Start with test tokens

Test keys share 125 million test tokens per organization each month, on every plan. The Free plan cannot buy credits: upgrade to Starter to use production keys. See Pricing.

Test and production keys

Key typeFormatCredit pool
Testtest_sk-{namespace}-{entropy}Monthly test tokens only
Productionprod_sk-{namespace}-{entropy}Purchased credits only

Each key belongs to one organization. Keys of the same type share that organization’s credit pool and rate limits.

Existing sk-ms- keys continue to work as test keys. Their secrets stay unchanged. They cannot spend purchased credits.

Show or copy a key

New test keys are encrypted at rest. Use Show or Copy on the API keys page to retrieve them later.

Production keys remain visible only when created. Only their hashes are stored. Save each production secret in your own secret store when you create it.

Older keys stored only as hashes cannot be recovered, including older test_sk- and legacy sk-ms- keys. They remain valid until revoked.

If you lost an older key, create a new test key. You do not need to revoke working keys to use the new workflow.

Use your workspace key automatically

The console playground uses your signed-in workspace’s test key on the server. You do not need to paste a key.

If an existing workspace has no active recoverable test key, the playground creates a reusable Playground test key when needed.

Demos automatically connect to your signed-in workspace and reuse its test key when the page loads. Automatic selection never supplies a production key.

Enable production access

Your organization must pay for a credit bundle of at least $10. This payment is the only production access requirement.

Auto top-up and a saved credit card are optional. Turning off auto top-up or removing a saved card does not disable production access.

The console disables production key creation until the qualifying bundle is paid. The console links to billing so you can buy credits.

Your lifetime paid spend and the age of your first payment determine the production tier. See Production tiers.

If eligibility changes, existing production keys return 403 production_access_disabled. The console shows a warning on every page while you have production keys without access.

Open Billing to refresh your status. If you have no qualifying purchase, buy a credit bundle of at least $10 to unlock production access. Test keys remain available with their separate allowance.

Need immediate assistance with a higher tier? Reach out to our support team: support@milliseconds.ai.

Keep the key secret. Hold it in an environment variable or a secret store, never in client-side code and never in a public repository. Revoke a leaked key in the console and create a new one.

Send the key

curl -s -X POST https://api.milliseconds.ai/v1/decision-machine-1/classify \
-H 'content-type: application/json' \
-H "authorization: Bearer $MS_API_KEY" \
-d '{
"text": "I was charged twice for my subscription this month.",
"labels": ["billing", "shipping", "account"]
}'

OpenAI clients

Set the client’s API key to your test or production key. Point base_url at https://api.milliseconds.ai/v1. The client then sends the right header itself.

from openai import OpenAI
client = OpenAI(base_url="https://api.milliseconds.ai/v1", api_key="test_sk-...")

When authentication fails

CodeStatusCause
missing_api_key401The request carries no Authorization: Bearer header.
invalid_api_key401The key is malformed, unknown or revoked.
production_access_disabled403The organization has no qualifying paid credit bundle, or its saved billing status needs a refresh.
{"error":{"code":"missing_api_key","message":"Send your key as Authorization: Bearer test_sk-..."}}
{"error":{"code":"invalid_api_key","message":"Incorrect API key provided."}}

Next