On this page
Compatibility
Platform resources
Presets, BYOK, guardrails, workspaces, external users, observability, SCIM, private endpoints, organization settings and OAuth.
Every resource below is real, account-scoped storage. An id from another account returns the same 404 as a missing row, and credential responses never include the secret.
Presets
A preset is a named, versioned request config. Posting a request body to a preset stores only the config keys (model, sampling, tools, …) and never the conversation.
BYOK credentials
Bring-your-own-key credentials managed through the API. The key is encrypted at rest; responses return a masked label only.
curl -X POST https://api.relayrouter.org/byok \ -H "Authorization: Bearer $RELAY_API_KEY" \ -H 'content-type: application/json' \ -d '{ "provider": "inferhub", "key": "sk-your-provider-key", "name": "production", "is_fallback": false, "allowed_models": ["deepseek-v4.1-flash-1017"] }'The provider must exist in the relay's provider registry; an unknown provider is rejected with 400.
Guardrails
Named policy bundles with optional ZDR, model, provider and content filters, assignable to keys and members in bulk.
curl -X POST https://api.relayrouter.org/guardrails \ -H "Authorization: Bearer $RELAY_API_KEY" \ -H 'content-type: application/json' \ -d '{ "name": "no-training", "enforce_zdr": true, "allowed_models": ["deepseek-v4.1-flash-1017"] }'
# assign by key hash or key idcurl -X POST https://api.relayrouter.org/guardrails/$GUARDRAIL_ID/assignments/keys \ -H "Authorization: Bearer $RELAY_API_KEY" \ -H 'content-type: application/json' \ -d '{ "key_hashes": ["<key hash>"] }'Assignment endpoints return counts: assigned_count / unassigned_count. Lists return data plus total_count.
Workspaces
Workspaces group members and budgets. Budget intervals are daily, weekly, monthly and lifetime (reset_interval: null).
curl -X POST https://api.relayrouter.org/workspaces \ -H "Authorization: Bearer $RELAY_API_KEY" \ -H 'content-type: application/json' \ -d '{ "slug": "team-a", "name": "Team A" }'
curl -X PUT https://api.relayrouter.org/workspaces/team-a/budgets/monthly \ -H "Authorization: Bearer $RELAY_API_KEY" \ -H 'content-type: application/json' \ -d '{ "limit_usd": 100, "include_byok_in_budgets": true }'External users, observability, SCIM
/external-usersregisters caller-supplied tracking ids. Deleting deactivates;PATCHsetsis_active./observability/destinationsstores a destination type, name and config (webhook, otel-collector, langfuse, …) with broadcast flags./scim/group-mappingsmaps SCIM groups to workspaces with a role./scim/sync-jobsrecords a sync job and can be polled.
Private endpoints
A private endpoint binds a model permaslug to a provider and upstream id. It starts as draft, can be validated, then activated; disable and enable toggle routing.
curl -X POST https://api.relayrouter.org/private-endpoints \ -H "Authorization: Bearer $RELAY_API_KEY" \ -H 'content-type: application/json' \ -d '{ "model_permaslug": "deepseek-v4.1-flash-1017", "provider_slug": "relayrouter", "upstream_model_id": "deepseek-v4.1-flash-1017", "base_url": "https://your-deployment.example.com", "declared_parameters": ["temperature"], "pricing": { "prompt": "0.000001" } }'
curl -X POST .../private-endpoints/$ID/validate -d '{ "workspace_id": "<id>" }'curl -X POST .../private-endpoints/$ID/activateOrganization and OAuth
GET/PATCH /organization/settings stores the account's catalog setting (is_filtered_model_catalog_enabled). GET /organization/members lists the account.
The OAuth flow is real PKCE: create a code with POST /auth/keys/code, then exchange it with POST /auth/keys and the matching code_verifier.POST /oauth/token implements RFC 8693 token exchange and requires a valid subject JWT.
PKCE is verified
A wrong code_verifier returns 400 and the code is not consumed. A code belongs to one account and expires after 10 minutes.