Examples

Create an API key and make your first call

Mint an sk-rg key, put it in your environment, and confirm it against the authenticated model list.

Goal

Get a working sk-rg- API key and prove it authenticates by listing the models your account can use.

Prerequisites

  • A Redgold account (invite-only at present).
  • curl.

Steps

Create the key from the API-keys page in the signed-in web application. The full value is shown once — copy it then. Minting a key requires an account session; an existing API key cannot mint another.

Put the key in your environment rather than typing it inline, so it stays out of shell history:

export REDGOLD_API_KEY=sk-rg-...

Call the authenticated model list. The key goes in the Authorization: Bearer header — the API reads the credential only from that header (or the web session cookie), and rejects a key supplied only as X-Api-Key with 401.

curl https://api.redgold.ai/v1/models \
  -H "Authorization: Bearer $REDGOLD_API_KEY"

Expected output

An OpenAI-style model-list envelope, with one entry per model your account can reach:

{
  "object": "list",
  "data": [{ "id": "model-id", "object": "model", "owned_by": "redgold" }]
}

Treat /v1/models as the authoritative list and read an identifier from it — the set changes independently of client code, and not every account sees every entry.

When it breaks

  • 401 — the key is missing, malformed, revoked, or was sent only as X-Api-Key. Re-check the header and the key value.
  • 402 — the account is out of model-API credits. See Check your model-API credit balance.

Source

Authentication and Model API.

Copyright © 2026