Skip to main content

DigitalOcean Gradient AI

Connect AISIX AI Gateway to DigitalOcean Gradient AI Serverless Inference so applications can call DigitalOcean-hosted foundation models through a stable model alias.

DigitalOcean exposes an OpenAI-compatible inference API. AISIX accepts the digitalocean community catalog provider and sends bearer-authenticated requests with the openai adapter.

SettingValue used by AISIX
Catalog provider IDdigitalocean
API basehttps://inference.do-ai.run/v1
Example upstream modelopenai-gpt-oss-120b
AuthenticationModel access key or DigitalOcean personal access token

Prerequisites

Prepare:

  • An AISIX Cloud environment with an attached gateway.
  • A Gradient AI model access key or a DigitalOcean personal access token that can call Serverless Inference.
  • Access to the selected foundation model.
  • curl and jq.

Export the AISIX connection details:

export AISIX_CP="http://localhost:8080/api"
export AISIX_TOKEN="aisix_pat_YOUR_ADMIN_TOKEN"
export ENV_ID="YOUR_ENVIRONMENT_ID"
export AISIX_PROXY="http://127.0.0.1:3000"

Configure the DigitalOcean Upstream

Create a Provider Key

export DIGITALOCEAN_INFERENCE_KEY="YOUR_MODEL_ACCESS_KEY"

PROVIDER_KEY_ID=$(
curl -sS -X POST "$AISIX_CP/provider_keys" \
-H "Authorization: Bearer $AISIX_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"display_name": "digitalocean-prod",
"provider": "digitalocean",
"api_key": "'"${DIGITALOCEAN_INFERENCE_KEY}"'",
"api_base": "https://inference.do-ai.run/v1",
"allowed_environments": ["'"${ENV_ID}"'"]
}' | jq -er '.provider_key.id'
)

echo "$PROVIDER_KEY_ID"

Use digitalocean as the catalog provider ID. AISIX derives the openai adapter; sending an explicit adapter on a catalog key returns a validation error.

The API base includes /v1. AISIX appends /chat/completions for chat requests.

Create a Model

Create an alias for a model currently available from Gradient AI:

MODEL_ID=$(
curl -sS -X POST "$AISIX_CP/environments/$ENV_ID/models" \
-H "Authorization: Bearer $AISIX_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"display_name": "digitalocean-gpt-oss-prod",
"model_name": "openai-gpt-oss-120b",
"provider_key_id": "'"${PROVIDER_KEY_ID}"'"
}' | jq -er '.model.id'
)

echo "$MODEL_ID"

Use the DigitalOcean model ID, not the original publisher repository name. Confirm current availability in the foundation-model reference before creating another alias.

Create a Caller API Key

AISIX_API_KEY=$(
curl -sS -X POST "$AISIX_CP/environments/$ENV_ID/api_keys" \
-H "Authorization: Bearer $AISIX_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"display_name": "digitalocean-caller",
"allowed_models": ["'"${MODEL_ID}"'"]
}' | jq -er '.plaintext'
)

echo "$AISIX_API_KEY"

Verify the Provider Connection

curl -sS -X POST "$AISIX_PROXY/v1/chat/completions" \
-H "Authorization: Bearer $AISIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "digitalocean-gpt-oss-prod",
"messages": [
{
"role": "user",
"content": "Say hello from DigitalOcean Gradient AI."
}
]
}'

AISIX forwards openai-gpt-oss-120b to https://inference.do-ai.run/v1/chat/completions with the DigitalOcean credential.

Endpoint Coverage

Chat completions is supported. AISIX can bridge compatible Responses and Anthropic Messages requests through the chat adapter. Embeddings require a Gradient AI embedding model and a compatible route on the same API base.

Image generation, video generation, and rerank do not accept the digitalocean provider value. See Provider Compatibility.

Troubleshooting

SymptomCheck
Upstream 401 or 403Confirm the model access key or personal access token has inference access.
Upstream 404Keep /v1 in api_base and verify the DigitalOcean model ID.
Model not foundConfirm the model remains available in the selected region or account.
Provider key creation returns 400Use provider: "digitalocean" without adapter.

For upstream and gateway-side rate controls, see Rate Limits.