Docs

Getting Started

Base URL

https://api.bgyhub.com

Authentication

Every request must include your API key as a Bearer token. Keep your key secret. Never commit it to source control or ship it in client-side code.

Authorization: Bearer YOUR_API_KEY

Your first request

The Messages endpoint accepts a model ID and a list of messages. Replace YOUR_API_KEY with the key you received.

curl https://api.bgyhub.com/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'

OpenAI-compatible endpoint

The same key also works with the OpenAI-style Chat Completions endpoint, which most SDKs and tools support.

curl https://api.bgyhub.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'

Available models

Use one of these model IDs in the model field.

  • claude-sonnet-5 — Claude Sonnet 5
  • claude-opus-5 — Claude Opus 5
  • gpt-5.6 — GPT-5.6

Errors and limits

Requests are rejected with HTTP 401 when the key is invalid, HTTP 402 when your balance is insufficient and HTTP 429 when you send too many requests. Retry 429 responses with exponential backoff.

HTTP/1.1 402 Payment Required
{"error": {"message": "Insufficient balance. Please add credit to continue."}}

Next steps

Back to docs