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.
from openai import OpenAI client = OpenAI( base_url="https://firmrock.ai/v1", # point here api_key="your API key", # your key)
Three ways
Python, Node or curl: the same two changes
Keep using the official openai package. No new SDK.
- 01
Python
Use the openai package. Pass base_url and api_key when creating the client; calls stay the same.
main.pyfrom 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)
- 02
Node
Use the openai package. Pass baseURL and apiKey when creating the client; calls stay the same.
index.mjsimport 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);
- 03
curl
No package at all. Send the request to firmrock.ai with your Firmrock key in the Authorization header.
Terminalcurl 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.
- 01
Put the model in model
Set model to the model's name, for example anthropic/claude-sonnet.
Today: Claudeclient.chat.completions.create( model="anthropic/claude-sonnet", messages=messages,)
- 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: GPTclient.chat.completions.create( model="openai/gpt", # only this line messages=messages,)
Compare
What you no longer do yourself
- One SDK, one key and one URL per providerOne key and one URL for 700+ models. The only package in your code is openai.
- Switching providers means changing your call codeChange the model string. That's it.
- Every provider fails differently, and you write the retriesNothing 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 reworkChange 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.