Firmrock
  • Solutions
  • Models
  • Rankings
  • Docs
  • Resources
  • 中文
  • English
Console

Product · OpenAI-compatible

Your existing code.Two lines changed.

The API is OpenAI-compatible. Point the base URL at https://firmrock.ai/v1, use a Firmrock API key, and leave the rest of your code alone. To go back, change those two lines back.

Get an API keyQuickstart
Two lines to change
from openai import OpenAI client = OpenAI(    base_url="https://firmrock.ai/v1",  # point here    api_key="your API key",  # your key)
Nothing else changes.

Three ways

Python, Node or curl: the same two changes

Keep using the official openai package. No new SDK.

  1. 01

    Python

    Use the openai package. Pass base_url and api_key when creating the client; calls stay the same.

    main.py
    from openai import OpenAI client = OpenAI(    base_url="https://firmrock.ai/v1",  # change    api_key="your API key",  # change) reply = client.chat.completions.create(    model="anthropic/claude-sonnet",    messages=[{"role": "user", "content": "Hello"}],)print(reply.choices[0].message.content)
  2. 02

    Node

    Use the openai package. Pass baseURL and apiKey when creating the client; calls stay the same.

    index.mjs
    import OpenAI from "openai"; const client = new OpenAI({  baseURL: "https://firmrock.ai/v1", // change  apiKey: "your API key", // change}); const reply = await client.chat.completions.create({  model: "anthropic/claude-sonnet",  messages: [{ role: "user", content: "Hello" }],});console.log(reply.choices[0].message.content);
  3. 03

    curl

    No package at all. Send the request to firmrock.ai with your Firmrock key in the Authorization header.

    Terminal
    curl https://firmrock.ai/v1/chat/completions \  -H "Authorization: Bearer $FIRMROCK_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "anthropic/claude-sonnet",    "messages": [{"role": "user", "content": "Hello"}]  }'
    First run: export FIRMROCK_API_KEY=your-key

Switch models

Switch providers by changing model

700+ models from 100+ providers, all on the same key and the same URL.

  1. 01

    Put the model in model

    Set model to the model's name, for example anthropic/claude-sonnet.

    Today: Claude
    client.chat.completions.create(    model="anthropic/claude-sonnet",    messages=messages,)
  2. 02

    To switch, change this one line

    The client, key, URL and the rest of your code stay as they are. No new SDK to add, no new key to request.

    Tomorrow: GPT
    client.chat.completions.create(    model="openai/gpt",  # only this line    messages=messages,)

Compare

What you no longer do yourself

Connecting to each provider
With Firmrock
  • One SDK, one key and one URL per provider
    One key and one URL for 700+ models. The only package in your code is openai.
  • Switching providers means changing your call code
    Change the model string. That's it.
  • Every provider fails differently, and you write the retries
    Nothing to write. On a timeout or a 5xx the request moves to the next provider within the same call, in under 20 ms. Failed requests are free.
  • The integration is hard-wired, so leaving means rework
    Change the base URL and key back, and you're out.

FAQ

About integrating

How much of my code changes?+

Two lines: set the base URL to https://firmrock.ai/v1 and use a Firmrock API key. Nothing else changes.

Do I need a different SDK?+

No. The API is OpenAI-compatible, so keep using the official openai package in Python or Node. Without a package, plain curl works too.

How do I switch back?+

Change the base URL and key back to what they were. No other code changes.

What do I change to use another model?+

Only model. 700+ models from 100+ providers, all on the same key and URL.

Can I limit which models a key can use?+

Yes. Each key has its own allowed models, budget and concurrency limit, and it stops at the limit.

Start

Get a key and change two lines

No monthly fee. Pay for what you use. If it's not for you, change the URL back.

Get an API keyQuickstart

Firmrock

Firmrock
  • 中文
  • English
© 2026 Firmrock

Solutions

  • AI Gateway
  • Data Security
  • Coding Agents

Models & pricing

  • All Models
  • Pricing
  • Model Rankings

Resources

  • Developer Docs
  • Latest Posts
  • Status

Product

  • Auto Failover
  • Usage Insights
  • Spend Control
  • Integrations
  • Access & Audit