Get access
GUIDE

How to use ONEWAY.

One API for many models, with spend you can see and control. You're signed in as owner; parts your role can't open are marked.

On this page

Start in five minutes

From nothing to a metered request.

  1. Create a project for each product or service, on the Overview. Usage, keys and budgets are per project; the balance is shared.
  2. Add your provider keys under Provider keys (owners and admins). A model works once its provider has a key; providers bill you directly. ONEWAY-provided models are coming soon.
  3. Create an API key on the project page. Copy it straight away: only a hash is stored, so it is shown once. Use a test key in development and a live key in production.
  4. Point your client at ONEWAY: base URL https://oneway-gateway.oneway-gateway.workers.dev/v1, your key as the Bearer token, and a model ID from Models.
  5. Watch it land on Requests a few seconds later, with its cost, tokens and latency.

The dashboard, page by page

What each page is for and who sees it in the sidebar.

PAGEWHAT IT'S FORWHO SEES IT
OverviewThis month's spend and requests, the model mix, every project and the latest requests. Create a project here.Everyone but members
ProjectsOpen one from the sidebar picker. Each has its own API keys, monthly budget, usage and a copy-paste quickstart.Everyone but members
UsageSpend by day, project, model, and by the customer and feature headers you send.Everyone but members
RequestsThe last 100 requests. Open one for its retries, fallbacks, attribution and (if kept) prompt and response.Everyone but members
My usageYour personal keys, your spend and limit, and your own recent requests.People in a department
DepartmentsSplit the balance into team allocations, add people, set personal limits and make service keys.Owners, admins, billing, leads
LeaderboardWho uses AI most, by requests and streaks on personal keys. Never shows spend.Everyone, when turned on
ModelsEvery model you can call, its ID, context window and price per million tokens.Everyone
BillingThe prepaid balance, runway, top-ups by card or UPI, payments and credit history.Owners, admins, billing
Provider keysYour own OpenAI, Anthropic, Gemini or Bedrock keys, and other OpenAI-compatible providers.Owners and admins
MembersWho is in the organisation and their role. Owners and admins invite people here.Everyone but members
Audit logEvery security-relevant change: keys, members, budgets, credits. Can't be edited.Owners and admins
SecurityTwo-factor authentication, passkeys and the devices signed in as you.You (shield icon, top right)

Calling the API

OpenAI- and Anthropic-compatible. Change the base URL and key; request bodies stay the same.

curl, on POST /v1/chat/completions (every model):

curl https://oneway-gateway.oneway-gateway.workers.dev/v1/chat/completions \
  -H "Authorization: Bearer $ONEWAY_API_KEY" \
  -H "content-type: application/json" \
  -d '{"model": "anthropic/claude-sonnet-5-5",
       "messages": [{"role": "user", "content": "Hello"}]}'

OpenAI SDK, JavaScript:

import OpenAI from "openai";

const ai = new OpenAI({
  baseURL: "https://oneway-gateway.oneway-gateway.workers.dev/v1",
  apiKey: process.env.ONEWAY_API_KEY,
  defaultHeaders: { "x-oneway-feature": "support-bot" },
});

const reply = await ai.chat.completions.create({
  model: "anthropic/claude-sonnet-5-5",
  messages: [{ role: "user", content: "Hello" }],
});

OpenAI SDK, Python, streamed:

import os
from openai import OpenAI

ai = OpenAI(base_url="https://oneway-gateway.oneway-gateway.workers.dev/v1", api_key=os.environ["ONEWAY_API_KEY"])

stream = ai.chat.completions.create(
    model="anthropic/claude-sonnet-5-5",
    messages=[{"role": "user", "content": "Hello"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Anthropic SDK, on POST /v1/messages (Claude models; the key works as x-api-key too):

import Anthropic from "@anthropic-ai/sdk";

const ai = new Anthropic({
  baseURL: "https://oneway-gateway.oneway-gateway.workers.dev",
  apiKey: process.env.ONEWAY_API_KEY,
});
  • Model IDs are provider/model. GET /v1/models lists the ones your key can call.
  • POST /v1/responses passes OpenAI's Responses API through for OpenAI models.
  • Streaming works on all three endpoints and is billed for its full usage.
  • Other OpenAI-compatible providers, added under Provider keys, Other providers, are called as custom/<name>/<model> on chat completions.
  • Keep keys on the server, in environment variables. Never ship one to a browser.
  • More examples, and the same reference without signing in, are in the developer docs.

Request headers

Optional. Attribution headers make Usage show who and what the spend is for.

HEADERSENT ONMEANING
x-oneway-customerRequestYour end customer's ID. Spend is broken down by it on Usage.
x-oneway-featureRequestWhich feature made the call, e.g. support-bot. Also on Usage.
x-oneway-agentRequestWhich agent or job made the call.
x-oneway-releaseRequestYour git commit or tag, for cost per deploy. The CLI's oneway release prints it.
x-oneway-retriesRequest0–3. Retries each provider with a short backoff before moving on.
x-oneway-fallbackRequestUp to three model IDs, comma-separated, tried in order if the first model fails.
x-request-idResponseThe request's ID. Search for it under Requests.
x-oneway-modelResponseThe model that answered (differs from yours after a fallback).
x-oneway-providerResponseThe provider that served it.
x-oneway-attemptsResponseHow many calls it took, including retries and fallbacks.
x-oneway-budget-warningResponseSet when a soft budget is passed: over-monthly-budget or over-department-budget.

Failed attempts aren't charged: you pay for the call that answered, at that model's price.

Controlling spend

Limits stack; the tightest one wins.

  • Balance. One prepaid USD balance for the whole organisation. Requests stop when it runs out. Top up on Billing.
  • Project budget. A monthly amount on each project. Without a hard cap you get the x-oneway-budget-warning header; with one, requests stop.
  • Department allocation. A team's monthly share of the balance, set on Departments. Leads get an email at 80% and 100%.
  • Personal limit. A monthly cap on one person's personal keys, always a hard stop.
  • Revoking a key or changing a budget reaches the gateway at once.

Errors and limits

Errors use OpenAI's error shape (Anthropic's on /v1/messages), with ONEWAY's reason in error.code.

STATUSCODEWHAT TO DO
400invalid_request_errorThe body isn't valid JSON, a header or field is malformed or unsupported (such as background responses), or the provider refused the request. The message says which.
400format_unsupportedThat model can't be called on this endpoint. Use /v1/chat/completions.
401authentication_errorNo API key was sent. Send it as Authorization: Bearer, or as x-api-key on /v1/messages.
401invalid_api_keyThe key is wrong or revoked. Check it was copied whole; a new key can take a minute to work after a failed try.
401expired_api_keyThe key has passed its expiry date. Create a new one on the project.
401provider_key_rejectedYour provider turned down the key saved under Provider keys. Replace it there.
402budget_exceededThe project hit its hard-capped monthly budget. Raise the budget on the project.
402department_budget_exceededThe department's monthly allocation is used up. Ask its lead.
402personal_limit_exceededYour personal monthly limit is reached. Ask your department lead.
402organization_limit_exceededThe organisation's monthly limit, set by ONEWAY support, is reached.
402insufficient_balanceThe ONEWAY balance is too low. Not returned while you use your own provider keys.
403provider_key_missingAdd a key for that model's provider under Provider keys.
403model_not_allowedThe model isn't enabled for this organisation. Contact support.
403organization_suspendedContact ONEWAY support.
403custom_provider_unmeteredYour own providers' models have no price in ONEWAY, so a key under a hard limit can't call them. Use a key without one.
404model_not_foundNo such model ID, or a fallback model is wrong. GET /v1/models lists them.
404custom_provider_not_foundNo provider by that name under Provider keys, Other providers. Check custom/<name>/<model>.
404not_found_errorUnknown path. Check the base URL ends in /v1.
413body_too_largeRequest bodies are limited to 4 MB. Send large files by URL, not inline.
429rate_limit_errorToo many requests for the key, the organisation, your IP or the provider. Back off and retry.
500server_errorA fault on our side. Retry, and send support the x-request-id.
502upstream_errorThe provider returned an error. Retry, or send x-oneway-fallback.
502upstream_unreachableThe provider couldn't be reached. Retry, or send x-oneway-fallback.
503provider_pausedThe model is briefly unavailable. Retry shortly, or send x-oneway-fallback.
503traffic_pausedONEWAY is paused for maintenance. The message says more; retry shortly.

Every response carries x-request-id. Look it up under Requests, or send it to support. Retry 429, 502 and 503 with backoff; other errors won't succeed on a retry.

LIMITVALUE
Requests per API key600 a minute
Requests per client IP1,200 a minute
Request body4 MB
x-oneway-fallback3 models
x-oneway-retries0 to 3
Attribution header values1–128 letters, digits and . _ : @ / -

Roles

Set per person on Members. Yours is highlighted.

ROLECAN
ownerYOUEverything, including billing and deleting the organisation. Needs 2FA.
adminYOUProjects, keys, members, departments and the audit log. Sees billing, can't pay. Needs 2FA.
developerYOUCreates projects and keys, reads usage and requests (with prompts, if logged).
billingYOUAdds credits, manages department allocations, reads usage.
viewerYOUReads usage and requests. Changes nothing.
memberYOUOnly their own keys and usage under My usage; a department lead also manages their department.

The CLI

Everything on this dashboard from your terminal, your AI assistant, or in plain English.

npx @oneway-ai/cli init          # sign in, link this folder to a project, put a key in .env.local
oneway                            # interactive: /dashboard /usage /members /departments …, questions
oneway dashboard                  # this overview, with the daily spend chart
oneway usage --chart requests     # spend, requests or latency per day
oneway usage --by release --since 7d   # by model, project, customer, feature, agent, release, key
oneway requests tail              # new requests as they land
oneway keys create | rotate | revoke <id>
oneway budget set 50 --hard       # monthly budget, hard cap
oneway topup 25                   # add credit: pay in the browser
oneway members invite dev@acme.com --role developer
oneway departments add Research dev@acme.com --limit 50
oneway me | leaderboard | audit | devices | providers | logs
oneway ask "why did spend jump yesterday?"
claude mcp add oneway -- npx @oneway-ai/cli mcp   # let Claude Code, Cursor or Codex manage ONEWAY

Sign-in works like gh auth login: approve the code in your browser. Signed-in terminals are listed on Security. The assistant and MCP tools never see API keys, and every change they propose waits for your OK; the audit log marks them agent and mcp.

Security

Why the dashboard sometimes asks again.

  • Owners and admins need two-factor authentication before creating keys, changing members or billing. Turn it on under Security.
  • Those actions also need a sign-in in the last 10 minutes. If asked, sign in again and repeat the action.
  • Passkeys sign you in with your fingerprint, face or device PIN, and can't be phished.
  • Prompts and responses are not stored unless an owner or admin turns it on under Requests, for 1, 7 or 30 days.