API

Model API

OpenAI- and Anthropic-compatible endpoints serving Redgold models at api.redgold.ai.

The public model API is served from https://api.redgold.ai. Every model behind it is a Redgold model. The flagship, redgold-flint, is a fusion model: one model interface backed by multiple expert models, with per-request routing across the experts handled inside the serving stack. redgold-flint-base is the same interface without the fusion routing layer.

The API speaks two wire formats, so you can reach the models with whichever SDK you already use: the OpenAI-compatible surface (/v1/chat/completions, /v1/responses) and the Anthropic-compatible surface (/v1/messages). Both authenticate the Redgold account, meter usage, and route to an available backend.

Discover models

Model availability changes independently of client code. Query the authenticated model list and use an identifier returned for your account.

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

The response follows the OpenAI model-list envelope:

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

The list contains identifiers for both API families. redgold-flint and redgold-flint-base use the OpenAI-compatible routes (/v1/chat/completions, /v1/responses). The remaining identifiers in your account's list are served through the Anthropic-compatible /v1/messages route; use one exactly as returned.

Treat /v1/models as authoritative and read identifiers from it rather than hard-coding them — the set changes independently of client code, and an account may not see every entry. An unknown identifier, or one sent to the wrong API family, returns a model-not-found error.

OpenAI Chat Completions

Use POST /v1/chat/completions with the normal OpenAI message shape. Both complete JSON responses and server-sent-event streams are supported.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.redgold.ai/v1",
    api_key=os.environ["REDGOLD_API_KEY"],
)

models = client.models.list()
print([model.id for model in models.data])
response = client.chat.completions.create(
    model="redgold-flint",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

For streaming, pass stream=True and consume the SDK iterator.

OpenAI Responses

POST /v1/responses accepts the OpenAI Responses shape for compatible models. Use this endpoint for clients that are built around the newer Responses API instead of Chat Completions.

curl https://api.redgold.ai/v1/responses \
  -H "Authorization: Bearer $REDGOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"model-id","input":"Hello"}'

Anthropic Messages

The Anthropic SDK should use the host without an added /v1 suffix because the SDK appends /v1/messages itself. The model API authenticates from the Authorization: Bearer header and does not read the x-api-key header the SDK sends by default, so present the key as a bearer token:

import os
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.redgold.ai",
    api_key="unused",  # the model API reads Authorization, not x-api-key
    default_headers={"Authorization": f"Bearer {os.environ['REDGOLD_API_KEY']}"},
)

with client.messages.stream(
    model="model-id-from-v1-models",
    max_tokens=256,
    messages=[{"role": "user", "content": "Hello"}],
) as stream:
    for text in stream.text_stream:
        print(text, end="")

Credits

GET /v1/credits returns the available model API credit balance for the authenticated account.

{ "balance_micros": 1000000, "balance_usd": 1.0 }

Streaming and errors

Streaming responses use server-sent events. An error before response headers returns a normal provider-shaped HTTP error. An error after a stream begins can arrive as an in-band error event. Clients should handle both cases.

Upstream 429 responses can reach the caller, but the provider's Retry-After header is not forwarded. Honor a Retry-After header when one is present and otherwise apply bounded exponential backoff. See limits and errors.

The generated public route inventory lists endpoints explicitly approved for external documentation. API contract details add request, response, streaming, error, limit, compatibility, and example guidance. Reachable platform routes absent from the inventory are outside the supported public contract.

Copyright © 2026