Skip to content
Docs

Quickstart

One Rate speaks the OpenAI API. If your code works with OpenAI, it works with One Rate after two small changes.

Get started

  1. Create an account at /register. A free account is enough to try the API.
  2. Create an API key on the API keys page. The full key is shown once, so copy it somewhere safe.
  3. Send a request to the base URL below with your key in the Authorization header.

Base URL

https://onerate.cloud/v1

Enterprise and team plans may be given a dedicated relay endpoint. Your plan page shows the exact base URL for your account.

Authentication

Send your key as a Bearer token on every request:

Authorization: Bearer YOUR_ONERATE_API_KEY
Keep keys on the server side. Never put a key in browser code or a public repository. If a key leaks, rotate or revoke it on the API keys page; you can also limit each key to the IP addresses you allow.

Examples

A chat completion in curl, Python (official openai package) and JavaScript (official openai npm package):

curl https://onerate.cloud/v1/chat/completions \
  -H "Authorization: Bearer $ONERATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello from One Rate"}]
  }'

Streaming

Set "stream": true to receive server-sent events in the standard OpenAI format, token by token.

stream = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Write a haiku"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Models

List the models your key can use:

curl https://onerate.cloud/v1/models -H "Authorization: Bearer $ONERATE_API_KEY"

Pass any returned id as the model field. A key can be limited to a subset of models; then only those are listed.

Errors & limits

StatusMeaningWhat to do
401Missing, wrong or revoked keyCheck the Authorization header and the key's status.
403Request from an IP the key doesn't allow, a model outside the key's list, or a paused accountUpdate the key's IP allow list or model list, or check your plan.
429Rate limit or plan quota reachedRetry with backoff, or move to a plan with more capacity.
5xxUpstream model or gateway problemRetry with backoff and check the status page.

Tools & SDKs

Anything that lets you set an OpenAI base URL works: the OpenAI SDKs, LangChain, LlamaIndex, Vercel AI SDK, Open WebUI, Continue, Cursor and similar tools. Use https://onerate.cloud/v1 as the base URL and your One Rate key as the API key.