Skip to content

API overview & authentication

Geeper Relay exposes these endpoint groups:

GroupPath prefixAuth
OpenAI-compatible inference/v1/chat/completions, /v1/responses, /v1/embeddings, /v1/modelsAPI key
Anthropic Messages API/v1/messagesAPI key
MCP protocol gateway/mcpMCP-scoped Relay API key
MCP gateway REST API/v1/mcp/*MCP-scoped Relay API key
Admin/internal/*Master key
Health/healthz, /readyzNone
Metrics/metricsMaster key by default

Relay-issued keys are the secure default. Optional passthrough/BYOK can be enabled explicitly.

Keys issued by Relay start with gr-. Pass them in the Authorization header:

Authorization: Bearer gr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Keys are issued via the admin API (POST /internal/api-keys) or via Google SSO. See First API key. Administrators can inventory, revoke, and atomically rotate keys through the same API; raw secrets are only returned at creation or rotation time.

Keys can expire and carry capability/data scopes:

ScopeAccess
chat/v1/chat/completions, /v1/messages, /v1/models
responses/v1/responses
embeddings/v1/embeddings
rag:repo:owner/nameRAG retrieval from one repository
rag:*RAG retrieval from all repositories
mcp:*All configured MCP servers and tools
mcp:server:*All tools from one MCP server
mcp:server:toolOne tool from one MCP server
*All API capabilities

Passthrough is disabled by default. When server.allow_passthrough_keys is explicitly set to true, a key that does not start with gr- is forwarded to the upstream provider. It receives chat, responses, and embeddings capability but no RAG scopes, and it is not written to Relay’s user-attributed usage/audit tables.

This lets employees point their existing SDK at Relay without being issued a separate key:

Terminal window
export ANTHROPIC_BASE_URL=https://relay.company.com
# ANTHROPIC_API_KEY stays as their own key — no changes needed

Works with any provider — Anthropic, OpenAI, Azure, Gemini, etc. The upstream provider authenticates the key; Relay never validates it.

Only enable this for trusted BYOK deployments where bypassing Relay identity and persistent accounting is acceptable.

The PROXY_MASTER_KEY grants full admin access and protects /metrics by default. Use it only for automation, monitoring, and key provisioning—never distribute it to end users. Startup rejects missing and known placeholder keys.

Authorization: Bearer <PROXY_MASTER_KEY>

Every response includes an x-request-id header with a UUID. Include this in bug reports and log queries.

Inference responses also include X-Relay-Deployment and X-Relay-Policy-Version so callers can correlate behavior with a concrete versioned routing decision.

All error responses use a consistent JSON shape:

{
"error": {
"type": "rate_limit_exceeded",
"message": "Token rate limit exceeded. Retry after 47 seconds.",
"code": 429
}
}

Common error types:

typeHTTP statusDescription
authentication_error401Invalid or missing API key
content_policy_violation400Blocked pattern or token limit exceeded
rate_limit_exceeded429Token-bucket limit hit
model_not_allowed400Model/deployment disallowed or missing a required capability
upstream_error502LLM provider returned an error
internal_error500Unexpected proxy error

On a 429 response:

Retry-After: 47

Value is seconds until the rate-limiting bucket refills enough to allow the request.