ospalabs
Guide · OpenRouter

OpenRouter spending limits: key caps, and what to add on top

Updated October 2026

OpenRouter has real per-key limits: you can give an API key a credit cap, and once it's used up, requests with that key fail with a 402. GET /api/v1/key shows a key's limit, what's left and when it resets. Newer workspace and guardrail budgets add controls at the account level.

What it can't see is your product: which of your customers or features made a request. That's where a layer in front helps.

  1. 01

    Give every key a credit limit

    Create one OpenRouter key per app or environment and set a limit on each. A key with no limit can spend your whole balance.

  2. 02

    Watch what's left

    Call GET /api/v1/key with the key to read limit, limit_remaining and limit_reset, and alert before it runs out rather than finding out from a 402.

  3. 03

    Handle the 402

    When a key's limit is used up, requests fail with HTTP 402. Don't retry; show a fallback and tell a person.

  4. 04

    Add per-customer and per-feature budgets with Fuse

    Add OpenRouter to a Fuse project as a custom provider (base URL https://openrouter.ai/api/v1), add the model ids you use, such as openai/gpt-4.1-mini, with their prices, and point your app at Fuse. Then send x-fuse-user and x-fuse-tag to cap each customer and feature separately.

    app.ts
    import OpenAI from "openai";
    
    const client = new OpenAI({
      baseURL: process.env.FUSE_BASE_URL,
      apiKey: process.env.FUSE_API_KEY,
    });
    
    await client.chat.completions.create(
      { model: "openai/gpt-4.1-mini", messages },
      { headers: { "x-fuse-user": customer.id, "x-fuse-tag": "chat" } },
    );

Questions

Do I need both OpenRouter limits and Fuse?
Not always. If one app uses one key and you only need a total cap, OpenRouter's key limit is enough. Add Fuse when you need daily ceilings per project, budgets per customer or feature, Slack alerts or a kill switch.
Where do Fuse's prices for OpenRouter models come from?
You enter them per model when you add it. Use the prices on OpenRouter's model page.