All API requests require a Bearer token. Generate keys in the dashboard and include them in every request.
API keys are prefixed with dai_ followed by a random string. Example:
dai_a1b2c3d4e5f6...
Keys are shown once at creation. Store them securely — we only persist a SHA-256 hash.
Pass the key in the Authorization header as a Bearer token:
Authorization: Bearer dai_a1b2c3d4e5f6...
With the OpenAI SDK, set it as the api_key parameter:
client = OpenAI(
base_url="https://api.agilecloud.ai/v1",
api_key="dai_a1b2c3d4e5f6...",
)Missing or invalid keys return a 401 Unauthorized response with a WWW-Authenticate: Bearer header:
{
"error": {
"message": "Invalid or missing API key",
"type": "authentication_error",
"code": "invalid_api_key"
}
}DIRECTAI_API_KEY