OpenBridgerGuides
中文 Open console

Make the first call

Do four things: register and sign in, confirm the wallet has credits, create an API key, and call POST /v1/chat/completions with curl.

Before you start

The registration form is the source of truth. The program default is a username or email plus a password. If the page asks for an email code or a human check, finish that first. Third-party login such as GitHub is available only when the sign-in page shows it.

Screenshot to add

The console after sign-in, with Wallet, API Keys, Model Square, and Usage Logs marked. Replace this note with a capture of the current UI.

Steps

Register and sign in

Open https://openbridger.com and enter the console. Too many failed sign-ins are throttled. Wait, then try again.

Check the wallet

Open the wallet. The balance is shown in yuan. Registration does not add credit, so a new account starts at 0. Add credit with the top-up or a redemption code on that page before the short chat. See Top up and redeem.

Copy a model ID

Open Model Square, pick a chat model your group can use, and copy the full model ID. Do not shorten the version.

Create an API key

Open API Keys and create a key named curl-test. The copied value starts with sk-. Details are on Create an API key.

Send one short request

Replace the key and model ID, then run the command.

export OPENBRIDGER_API_KEY="sk-paste-the-key-from-the-console"
export OPENBRIDGER_MODEL="full-model-id-from-model-square"

curl "https://openbridger.com/v1/chat/completions" \
  -H "Authorization: Bearer ${OPENBRIDGER_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "{
    \"model\": \"${OPENBRIDGER_MODEL}\",
    \"messages\": [{\"role\": \"user\", \"content\": \"Reply with one word: pong\"}]
  }"

A successful body is JSON with choices[0].message.content. The response header X-Oneapi-Request-Id is the id to keep if the call fails.

Confirm the call hit the gateway

  1. Open Usage Logs.
  2. Filter by the time and the key name curl-test.
  3. Check the model ID, status, and charge. A matching row means the client did not send the request somewhere else.

The Playground can test the same model with your login session. It does not use the API key, so it does not replace the curl above.

Errors at this step

What you see What to do
401, message says the token is invalid The key was copied wrong, disabled, expired, or its own credit is used up. Copy it again. Do not type a second Bearer or sk-.
403, message says user quota is insufficient The wallet or the current funding source cannot cover the reserve. Add credits or send a smaller request. See Credits and billing.
503, message says no channel is available The model ID is wrong, or this group has no route. Copy it again from Model Square.
Connection failed or timed out The URL must be https://openbridger.com/v1/chat/completions, not /v1/v1/. Then see Troubleshooting.

The full table is on Error codes.

Next

Type to search