# Quickstart

> Four steps: get an API key, choose a model, send your first request and see the usage in the console.

The examples use the OpenAI Chat Completions format; the Anthropic and Gemini formats and each tool's setup are linked at the end.

## 1. Get an API key

1. [Register](https://relayvia.dev/register) an account and verify your email. Accounts with an unverified email cannot create API keys or top up.
2. Top up on the console's [Billing](https://relayvia.dev/app/wallet) page. Credits are prepaid in US dollars and shared by every team member and API key of the account.
3. Create a key on the [API keys](https://relayvia.dev/app/tokens) page. It starts with `sk-`, and you can limit its credits, models and source IPs.

> **Warning**
>
> The full key is shown only once, right after you create it. Save it somewhere safe; if you lose it, create a new one.

## 2. Choose a model

Use the official model name, for example `claude-opus-5`, `gpt-5.5` or `gemini-3.6-flash`. Prices and capabilities are in the [model catalog](https://relayvia.dev/models); the [model list](https://relayvia.dev/docs/models) explains how to see which models your key can use.

## 3. Send your first request

Send a Chat Completions request to `https://api.relayvia.dev/v1` with your key in the `Authorization` header. If a reply comes back, you are set up.

**cURL**

```bash
curl https://api.relayvia.dev/v1/chat/completions \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.5","messages":[{"role":"user","content":"Hello!"}]}'
```

**Python**

```python
from openai import OpenAI

client = OpenAI(base_url="https://api.relayvia.dev/v1", api_key="sk-...")
resp = client.chat.completions.create(model="gpt-5.5", messages=[{"role": "user", "content": "Hello!"}])
print(resp.choices[0].message.content)
```

**JavaScript**

```javascript
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.relayvia.dev/v1", apiKey: "sk-..." });
const resp = await client.chat.completions.create({
  model: "gpt-5.5",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);
```

> **Tip**
>
> Using the Anthropic or Gemini SDK? See [Messages](https://relayvia.dev/docs/api/messages) and [Gemini native](https://relayvia.dev/docs/api/gemini). For Claude Code, Codex CLI and other tools, see the integration guides below.

## 4. See the usage in the console

Every request appears in [Usage logs](https://relayvia.dev/app/logs) with its model, tokens, charge and latency, and [Usage](https://relayvia.dev/app/activity) shows totals by day and model. Each response carries an `x-robi-request-id` header that matches its log entry.

To check from code, call [/v1/balance](https://relayvia.dev/docs/api/balance) for the credits your key can still spend and [/v1/usage](https://relayvia.dev/docs/api/usage) for its usage.

## Next: set up your tool

- [Claude Code](https://relayvia.dev/docs/tools/claude-code): Install Claude Code and point it at Relayvia with a settings file or environment variables.
- [Codex CLI](https://relayvia.dev/docs/tools/codex-cli): Install Codex CLI and add Relayvia to ~/.codex/config.toml.
- [Cursor](https://relayvia.dev/docs/tools/cursor): Enter Relayvia's URL and your API key in Cursor's model settings.
- [Cherry Studio](https://relayvia.dev/docs/tools/cherry-studio): Add an OpenAI-type model service in Cherry Studio that points at Relayvia.
