Updated
Abliterated LLM API errors
Errors come back as JSON with a message, a type and a code, and the status says whether to retry. Messages uses Anthropic's error shape with the same status codes.
https://api.silkcompute.com
{
"error": {
"message": "<what went wrong>",
"type": "<error type>",
"code": "concurrent_request_limit"
}
}{
"type": "error",
"error": {
"type": "<error type>",
"message": "<what went wrong>"
}
}client = OpenAI(
base_url="https://api.silkcompute.com",
api_key=os.environ["SILK_API_KEY"],
max_retries=5, # retries 429 and 5xx with backoff
)const client = new OpenAI({
baseURL: 'https://api.silkcompute.com',
apiKey: process.env.SILK_API_KEY,
maxRetries: 5, // retries 429 and 5xx with backoff
})client := openai.NewClient(
option.WithBaseURL("https://api.silkcompute.com"),
option.WithAPIKey(os.Getenv("SILK_API_KEY")),
option.WithMaxRetries(5), // default is 2
)How it works
Retry429 and 503Retry 429 after the
Retry-After header and 503 after a short wait, with backoff.Fix first400, 401, 402 and 404Fix the request or the account before you retry these.
Requests at once8 per accountA ninth waits up to 5 seconds for a slot, then returns
429 concurrent_request_limit.Status codes
| Status | Code | Meaning | Retry |
|---|---|---|---|
| 400 | model_required | No model, or the body is not valid JSON. | No |
| 401 | invalid_api_key | The key is missing, wrong or revoked. | No |
| 402 | insufficient_credits | The balance is too low. | After a top-up |
| 402 | plan_limit_reached | The plan's month is used up. | After a top-up |
| 403 | video_not_available | Video input is off until a new account builds some history. | No |
| 404 | model_not_found | The id is not an active model. Retired ids stay here. | No |
| 413 | request_too_large | The body is over 64 MiB. | No |
| 429 | concurrent_request_limit | Eight requests are already running. | Yes |
| 429 | rate_limited, rate_limit_exceeded | Too many requests. | After Retry-After |
| 503 | under_capacity | The model is briefly unavailable. | Yes, with backoff |