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

StatusCodeMeaningRetry
400model_requiredNo model, or the body is not valid JSON.No
401invalid_api_keyThe key is missing, wrong or revoked.No
402insufficient_creditsThe balance is too low.After a top-up
402plan_limit_reachedThe plan's month is used up.After a top-up
403video_not_availableVideo input is off until a new account builds some history.No
404model_not_foundThe id is not an active model. Retired ids stay here.No
413request_too_largeThe body is over 64 MiB.No
429concurrent_request_limitEight requests are already running.Yes
429rate_limited, rate_limit_exceededToo many requests.After Retry-After
503under_capacityThe model is briefly unavailable.Yes, with backoff