beatra

Quickstart

Make your first beatra text chat call in 5 minutes.

This is the fastest path from zero to a working text chat call. Everything below uses the currently callable API.

1. Get a key

Sign up at dashboard.beatra.ai, create an API key, and put it in your shell:

export BEATRA_API_KEY="<YOUR_KEY>"
export BEATRA_BASE_URL="https://api.beatra.ai/v1"

2. Send your first request

curl "$BEATRA_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $BEATRA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "model": "auto",
    "messages": [{"role": "user", "content": "Say hi in five words."}]
  }'
from openai import OpenAI
 
client = OpenAI(
    base_url="https://api.beatra.ai/v1",
    api_key="<YOUR_KEY>",
)
 
resp = client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "Say hi in five words."}],
)
print(resp.choices[0].message.content)
import OpenAI from "openai";
 
const client = new OpenAI({
  baseURL: "https://api.beatra.ai/v1",
  apiKey: process.env.BEATRA_API_KEY,
});
 
const response = await client.chat.completions.create({
  model: "auto",
  messages: [{ role: "user", content: "Say hi in five words." }],
});
console.log(response.choices[0].message.content);

3. What you get back

{
  "id": "chatcmpl_01J5...",
  "model": "<the model that handled the request>",
  "choices": [
    {
      "message": { "role": "assistant", "content": "Hi there my friend!" },
      "finish_reason": "stop"
    }
  ]
}

Keep two things from every response:

  • The model field — it tells you which model actually handled the request, useful for support and evaluation.
  • The X-Request-Id response header — store it next to the user-visible job; it's the fastest support lookup key.

If something goes wrong

A bad key returns:

{
  "error": {
    "code": "invalid_api_key",
    "message": "API key not found, signature mismatch, disabled, or revoked.",
    "retryable": false
  }
}

retryable: false means don't loop — fix the request before trying again. The full rule lives in Errors & retries.

Other Preview endpoints

Music generation, single-shot uploads, and task lookup are callable Preview APIs. Start from Music generation or the API Reference. Image, video, speech, voices, resumable uploads, and customer callbacks are still Planned.

Where to go next

On this page