Skip to documentation

Providers

Providers

Understand providers, credentials, and configured models; add them in the dashboard or through the API.

A Provider is the upstream service Relay calls. A Credential authenticates Relay to that service. A Model is a configured upstream model, with its supported request type, pricing, and limits.

Clients use the model's displayed provider/model call name. Configuring several providers lets Groups choose among their models.

Dashboard

  1. In Providers, choose Add API Key Provider to open Setup.
  2. Import the provider's curl request or enter its connection details. Add its API key in the credential field.
  3. Review the model, request type, pricing, and available limits; save the configuration.
  4. On Providers, use Add model to add another model to that provider. Edit, duplicate, or delete through the row actions.

Hosted Subscription Plan Providers use a separate account-connection flow. OpenAI Codex is available where enabled: authorize the account, verify it, then enable discovered models. This does not mean arbitrary subscriptions are supported. Ordinary API-key providers remain available when self-hosting.

API

Use a key with the relevant permissions; see API authentication. Replace placeholders with IDs from the corresponding list or create response.

Management requires relay:providers:read or relay:providers:manage. List and create responses contain public id values. There is currently no separate GET /providers/<PROVIDER_ID> or GET /endpoints/<MODEL_ID>; find the item in its list response.

List providers

curl 'https://api.anchorshell.com/api/relay/providers' \
  -H 'Authorization: Bearer <API_KEY>'

Response — 200 OK

Selected response fields shown; IDs and values are illustrative.

[
  {
    "id": "<PROVIDER_ID>",
    "name": "OpenAI",
    "slug": "openai",
    "base_url": "https://api.openai.com/v1",
    "auth_mode": "bearer_static",
    "enabled": true
  }
]

Create a provider

curl -X POST 'https://api.anchorshell.com/api/relay/providers' \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "OpenAI",
  "base_url": "https://api.openai.com/v1",
  "auth_mode": "bearer_static",
  "enabled": true
}'

Response — 201 Created

Selected response fields shown; IDs and values are illustrative.

{
  "id": "<PROVIDER_ID>",
  "name": "OpenAI",
  "slug": "openai",
  "base_url": "https://api.openai.com/v1",
  "auth_mode": "bearer_static",
  "enabled": true
}

Update a provider

curl -X PUT 'https://api.anchorshell.com/api/relay/providers/<PROVIDER_ID>' \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "OpenAI production",
  "base_url": "https://api.openai.com/v1",
  "auth_mode": "bearer_static",
  "enabled": true
}'

Response — 200 OK

Selected response fields shown; IDs and values are illustrative.

{
  "id": "<PROVIDER_ID>",
  "name": "OpenAI production",
  "slug": "openai",
  "base_url": "https://api.openai.com/v1",
  "auth_mode": "bearer_static",
  "enabled": true
}

Save a credential

curl -X POST 'https://api.anchorshell.com/api/relay/credentials' \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "provider_id": "<PROVIDER_ID>",
  "name": "OpenAI key",
  "secret": "<PROVIDER_API_KEY>",
  "enabled": true
}'

Response — 201 Created

Selected response fields shown; IDs and values are illustrative.

{
  "id": "<CREDENTIAL_ID>",
  "provider_id": "<PROVIDER_ID>",
  "name": "OpenAI key",
  "has_secret": true,
  "enabled": true
}

The credential response exposes metadata, not its secret. Save its id for the model.

List models

curl 'https://api.anchorshell.com/api/relay/endpoints' \
  -H 'Authorization: Bearer <API_KEY>'

Response — 200 OK

Selected response fields shown; IDs and values are illustrative.

[
  {
    "id": "<MODEL_ID>",
    "provider_id": "<PROVIDER_ID>",
    "credential_id": "<CREDENTIAL_ID>",
    "name": "gpt-5-mini",
    "upstream_model": "gpt-5-mini",
    "route_kind": "chat",
    "enabled": true
  }
]

Create a model

curl -X POST 'https://api.anchorshell.com/api/relay/endpoints' \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "provider_id": "<PROVIDER_ID>",
  "credential_id": "<CREDENTIAL_ID>",
  "name": "gpt-5-mini",
  "upstream_model": "gpt-5-mini",
  "route_kind": "chat",
  "enabled": true
}'

Response — 201 Created

Selected response fields shown; IDs and values are illustrative.

{
  "id": "<MODEL_ID>",
  "provider_id": "<PROVIDER_ID>",
  "credential_id": "<CREDENTIAL_ID>",
  "name": "gpt-5-mini",
  "upstream_model": "gpt-5-mini",
  "route_kind": "chat",
  "enabled": true
}

Use an upstream model your provider account can access.

Update a model

curl -X PUT 'https://api.anchorshell.com/api/relay/endpoints/<MODEL_ID>' \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Support model",
  "upstream_model": "gpt-5-mini",
  "route_kind": "chat",
  "enabled": true
}'

Response — 200 OK

Selected response fields shown; IDs and values are illustrative.

{
  "id": "<MODEL_ID>",
  "provider_id": "<PROVIDER_ID>",
  "credential_id": "<CREDENTIAL_ID>",
  "name": "Support model",
  "upstream_model": "gpt-5-mini",
  "route_kind": "chat",
  "enabled": true
}

Delete a model

curl -X DELETE 'https://api.anchorshell.com/api/relay/endpoints/<MODEL_ID>' \
  -H 'Authorization: Bearer <API_KEY>'

Response — 204 No Content

No response body.

Delete a provider

curl -X DELETE 'https://api.anchorshell.com/api/relay/providers/<PROVIDER_ID>' \
  -H 'Authorization: Bearer <API_KEY>'

Response — 204 No Content

No response body.

Deletion removes that resource from routing. Check affected groups before deleting.

Next

Groups.