Documentation

Make your first call to the Apiário Dev API in under 5 minutes.

Get your API key

Create an account on our platform and generate your first API key. A single key that works with all models and compatibility formats.

1. Create account
2. Generate API key in the dashboard
3. Copy the key (sk-...)

First API call

Use the OpenAI-compatible endpoint to make your first request. Replace $APIARIO_KEY with your key.

curl https://api.apiario.dev/v1/chat/completions \
  -H "Authorization: Bearer $APIARIO_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "maritaca/sabia-4",
    "messages": [
      {"role": "user", "content": "Olá! Quem é você?"}
    ]
  }'
from openai import OpenAI

client = OpenAI(
    base_url="https://api.apiario.dev/v1",
    api_key="$APIARIO_KEY"
)

response = client.chat.completions.create(
    model="maritaca/sabia-4",
    messages=[
        {"role": "user", "content": "Olá! Quem é você?"}
    ]
)

print(response.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.apiario.dev/v1",
  apiKey: process.env.APIARIO_KEY,
});

const response = await client.chat.completions.create({
  model: "maritaca/sabia-4",
  messages: [
    { role: "user", content: "Olá! Quem é você?" }
  ],
});

console.log(response.choices[0].message.content);

Models & Pricing

Browse all available models via GET /v1/models. Prices are displayed in BRL per 1 million tokens, for both input and output.

curl https://api.apiario.dev/v1/models \
  -H "Authorization: Bearer $APIARIO_KEY"

Check the Models page for the full list with current prices in BRL per 1 million tokens.

Tokens & Usage

Each request consumes credits proportionally to the number of tokens processed. Track your usage in real time on the dashboard. 1 credit = R$ 0.001.

  • 1 crédito = R$ 0,001
  • Each request debits credits from your balance in real time
  • Track on the dashboard: daily usage, by model, period totals
  • Export reports in CSV

Rate Limit & Isolation

Each upstream provider (OpenAI, Anthropic, Maritaca, etc.) sets its own rate limits (RPM, TPM). Apiário Dev transparently relays these limits. Each API key has its own isolation — check response headers to monitor your consumption.

Each provider defines its own limits independently. The HTTP header X-RateLimit-Remaining indicates how many requests remain in the current minute for that provider.

Error Codes

The API uses standard HTTP status codes. Validation errors return 422, insufficient credits return 402, and upstream provider errors are forwarded in the appropriate format (OpenAI, Anthropic, or Ollama).

HTTP Meaning Common cause
400 Bad request Malformed JSON
401 Unauthorized Invalid or missing API key
402 Insufficient credits Zero or insufficient balance
404 Not found Unknown model or wrong route
422 Validation error Missing required field or invalid type
429 Rate limit exceeded Too many requests in short period
5xx Server error Temporary server or upstream provider error

Next steps

Explore the dashboard to manage your keys, track usage, and top up credits.

Frequently Asked Questions

Common questions about the Apiário Dev API.

01 How do I top up my account?

Go to the credits dashboard and choose between R$ 10, R$ 30 or R$ 50. Payment is via PIX (instant) or credit card.

02 How does billing work?

Credits are deducted in real time per request. 1 credit = R$ 0.001. Each request is priced based on input and output tokens for the model used.

03 Which models are available?

We offer dozens of models from top providers: OpenAI, Anthropic, Google, Meta, DeepSeek, Maritaca, and more. Check our Models page for the full list with current prices.

04 What happens if I run out of credits?

The API returns HTTP 402 (Payment Required). Your account is not blocked or auto-charged. Just top up to resume normal use.