Account

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.

Permissions and prerequisites

Use a dedicated account key and a trusted MCP client. Child keys are not accepted by this account-level server. Clients can read account usage, create or revoke keys, and run billed test calls. Require confirmation for write actions; a spending cap is not a restriction on account-management permissions.

The Claude Desktop configuration below uses Node.js and npx to run mcp-remote. Merge the Straitly entry into your existing mcpServers configuration rather than replacing other servers.

Connect your client

~/.cursor/mcp.json, or .cursor/mcp.json inside a project

json
{
  "mcpServers": {
    "straitly": {
      "url": "https://straitly.ai/api/mcp",
      "headers": {
        "Authorization": "Bearer sk-YOUR_KEY"
      }
    }
  }
}

Swap sk-YOUR_KEY for a key from API keys, then restart your client.

Available tools

8 tools. The ones that change something are marked.

ToolWhat it does
get_balanceGet the current Straitly credit balance, lifetime top-ups, and lifetime spend for the account that owns the API key.read only
list_modelsList 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_keysList the account's API keys: label, masked prefix, creation time, and whether each is active or revoked.read only
create_keyCreate a new Straitly API key and return the plaintext key once. New keys take about 15 seconds to become usable.writes
revoke_keyRevoke an API key by the masked prefix that list_keys returns. Takes effect within about 15 seconds.writes
get_usageQuery 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_analyticsAggregated usage: total spend, requests, tokens, cache hit rate, error rate, average latency, and a per-model breakdown over a time window.read only
test_requestSend 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

Verify the connection

Start with a read-only question about your balance. Review the tool name and arguments before approving a tool call. A live model test can consume credits.

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.

Troubleshooting and access

If authentication fails, check the account key and restart the client after changing its configuration. For npx errors, verify Node.js is installed. Revoke the dedicated key if you no longer trust the client.

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.