START HERE

3 steps to your first reply

  1. Verify your email from the link we sent, then sign in to the console.
  2. Open API keys in the console and copy a key. The full key is shown only once.
  3. Open Playground, paste the key, type a message, and press Send request.

The API address is not a webpage. Do not open it in the browser; Playground sends the request for you.

The production upstream is not connected yet. Until it is, Playground shows a clear upstream message instead of a reply.

AFTER THE KEY IS CREATED

Your first request, start to finish.

This walkthrough takes you from the key you just created to a working request and a charge you can see in the console. Follow it in order. Most people finish in about ten minutes.

Before you start

You need the key you just copied, a terminal, and about ten minutes. If you closed the key window without copying it, revoke that key in the console and create a new one. The full key is shown only once.

1. Save the key before you leave the page

After you click create, the console shows the full key one time. Copy it now. Replace YOUR_LINKINT_API_KEY in the examples with your own key.

YOUR_LINKINT_API_KEY

Put it in a password manager, or in a local file that never goes into Git. For local testing, an .env file is enough:

LINKINT_API_KEY=YOUR_LINKINT_API_KEY
LINKINT_BASE_URL=https://linkint.net/v1
After creation, copy the key first. The usage tutorial button opens this page in a new tab, so the key stays on screen.

Do not put the key in browser JavaScript, a public GitHub repository, a screenshot, or a support ticket.

Anyone with the key can spend your credit.

2. Pick the exact model ID

Open the model catalog and choose a model. Copy the full ID, including the provider prefix. A prefix is part of the name, so a short name alone will not work.

Copy the full model ID. Keep the provider prefix and the dot exactly as shown.

If you plan to test several models, write them down. A 404 for the model usually means the ID is incomplete or the model is not enabled for your account.

3. Send a request with curl

The endpoint is the site address plus /v1/chat/completions. Every request needs two headers: your key and the JSON content type.

macOS or Linux: paste this into a terminal and replace the key with your own.

export LINKINT_API_KEY="sk-nb-your-key"

curl https://linkint.net/v1/chat/completions \
  -H "Authorization: Bearer $LINKINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-6.1-terra",
    "messages": [
      {"role": "user", "content": "Hello, please reply in one short sentence."}
    ]
  }'

Windows PowerShell: use curl.exe, not curl.

In PowerShell, curl is an alias for another command, and a long JSON string is easy to break while quoting. The cleanest fix is to put the body in a file:

$env:LINKINT_API_KEY="sk-nb-your-key"

@'
{"model":"openai/gpt-6.1-terra","messages":[{"role":"user","content":"Hello"}]}
'@ | Set-Content -Encoding utf8 body.json

curl.exe https://linkint.net/v1/chat/completions `
  -H "Authorization: Bearer $env:LINKINT_API_KEY" `
  -H "Content-Type: application/json" `
  --data "@body.json"

Two details matter more than anything else here. The word Bearer is followed by one space, and the JSON uses double quotes. If you change the key, keep the rest of the command as it is.

4. Send the same request with Python

If you already use the OpenAI SDK, only three things change: the base URL, the key, and the model ID. Install the current SDK first:

pip install --upgrade openai

Save this as first_call.py and run it with python first_call.py:

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://linkint.net/v1",
    api_key=os.environ["LINKINT_API_KEY"],
)

response = client.chat.completions.create(
    model="openai/gpt-6.1-terra",
    messages=[{"role": "user", "content": "Hello"}],
)

print(response.choices[0].message.content)
print(response.usage)

Set the key in the same terminal before running the script. On macOS or Linux use export; on PowerShell use $env:. The script reads the key from the environment, so it never appears in the file.

Why use the environment?

It keeps the key out of your source code. If you later commit the project, the key is not in the commit history.

5. Read the response

A successful request returns HTTP 200 and a JSON object. The text is in choices[0].message.content. The usage block tells you how many input and output tokens were billed.

What a normal reply looks like. Your model, text, token counts and timing will differ.

If the response is a stream, you will see many small chunks instead of one JSON object. Each chunk still ends with the done marker. Collect the delta content fields to rebuild the text.

6. Confirm the request in the console

Open Console, then Usage. The request should appear within a few seconds with its model, token counts, cost and latency. The Ledger page shows the credit movement.

Usage is recorded per key and per day, so you can compare two applications without guessing.

Credit is reserved while a request runs and settled when it finishes. A failed request releases its reservation. During a refund review the balance is frozen, so available credit can be lower than the balance shown at the top of the page.

7. Fix the common errors

What you seeWhat it usually meansWhat to do
401 UnauthorizedThe key is missing, wrong or revoked.Check the Authorization header. It must start with Bearer and one space. Do not add quotes around the key. Create a new key if this one was revoked.
402 Payment RequiredAvailable credit is too low.Open the console and compare balance, available and reserved credit. Top up when purchasing is open.
400 Bad RequestThe JSON is malformed, or the model ID is wrong.Validate the JSON, keep double quotes, and copy the model ID again from the catalog.
403 or 404The account cannot use this model, or the ID does not exist.Check the account status and the enabled model list. Remove extra spaces from the ID.
429 Too Many RequestsYou are sending requests faster than the current limit.Reduce concurrency and retry with a short backoff. Do not retry in a tight loop.
500 or 503The service or the upstream model is unavailable.Wait a minute and retry once. If it keeps failing, try another model and send support the request time.
Request hangsA network path or proxy is blocking the request.Test with a short timeout, check your proxy settings, and try from another network.

Fast checks

Does the URL end in /v1? Is the method POST? Is the JSON content type present? Is the key from this site and not from another provider?

8. Keep the key safe, then build

  • Use one key per application. If one leaks, revoke only that key.
  • Store keys in environment variables or a secrets manager, never in front-end code.
  • Revoke an old key after you rotate it. Revocation takes effect immediately.
  • Do not paste a full key into a support ticket. The last four characters are enough to identify it.
  • For a shared server, restrict who can read the process environment.

When the first request works, continue with the pages below.

That is the whole loop.

Create a key, send a request, read the response, check the usage. Everything else is a variation of these four steps.

9. Coding tool compatibility

Claude Code and Codex workflows are currently unsupported.

linkint accepts text-only Chat Completions. Tool calls, Anthropic Messages and the OpenAI Responses API are unsupported. CC Switch can translate request formats, but the gateway still needs tool support for coding workflows.

The local demo verifies basic text requests with simulated responses. Online model requests require a connected upstream.

Try the text API quickstart