MCP
Straitly runs a Model Context Protocol server. Give any MCP client your API key and your coding agent can read per-request logs, summarize spend by model, check your balance, mint or revoke keys, and fire a live test request. It is the same key as the API, so there is no second credential.
Setup
~/.cursor/mcp.json, or .cursor/mcp.json inside a project
{
"mcpServers": {
"straitly": {
"url": "https://app.straitly.ai/api/mcp",
"headers": {
"Authorization": "Bearer sk-YOUR_KEY"
}
}
}
}jsonSwap sk-YOUR_KEY for a key from API keys, then restart your client.
8 tools. The ones that change something are marked.
| Tool | What it does | |
|---|---|---|
| get_balance | Get the current Straitly credit balance, lifetime top-ups, and lifetime spend for the account that owns the API key. | read only |
| list_models | List the models this gateway serves, with per-million-token pricing for input, output, and cache reads. Includes whether each model is currently callable. | read only |
| list_keys | List the account's API keys: label, masked prefix, creation time, and whether each is active or revoked. | read only |
| create_key | Create a new Straitly API key and return the plaintext key once. New keys take about 15 seconds to become usable. | writes |
| revoke_key | Revoke an API key by the masked prefix that list_keys returns. Takes effect within about 15 seconds. | writes |
| get_usage | Query per-request logs. Returns one entry per API request with exact token buckets (fresh input, cache read, cache write, output), latency, cost, and any error. Use this to debug spend or failures. | read only |
| get_analytics | Aggregated usage: total spend, requests, tokens, cache hit rate, error rate, average latency, and a per-model breakdown over a time window. | read only |
| test_request | Send a small live chat completion through the gateway to verify the key and a model work end to end. Costs a fraction of a cent. | writes |
Once it is connected, ask in plain English:
- What is my Straitly balance and how long will it last at my current burn rate?
- Show me every failed Straitly request in the last 24 hours and why they failed.
- Which model is costing me the most this week?
- Create a Straitly key called ci-runner and add it to my .env.
- Test that claude-sonnet-5 is working through Straitly right now.
Account deletion is deliberately not exposed over MCP. Creating and revoking keys is recoverable, deleting an account is not, so that one stays behind a human confirmation in Settings.
