API Overview

The LongCat API Platform provides AI model proxy services for the LongCat model family, compatible with both the OpenAI and Anthropic API formats. This documentation follows standard API conventions.

All endpoints are accessed through the unified production endpoint https://api.longcat.chat using Bearer Token authentication.

Base URL

https://api.longcat.chat

Authentication

All API requests must authenticate with an API key in the Authorization header:

http
Authorization: Bearer YOUR_API_KEY

Endpoints

Error Responses

The API uses conventional HTTP response codes to indicate success or failure:

CodeStatusDescription
200OKRequest succeeded
400Bad RequestInvalid parameters or malformed JSON
401UnauthorizedAPI key invalid or missing
402Payment RequiredInsufficient token quota
403ForbiddenAPI key lacks permission for the resource
429Too Many RequestsRate limit exceeded
500Internal Server ErrorThe server encountered an unexpected condition
502Bad GatewayInvalid response from upstream server
503Service UnavailableThe server is temporarily unavailable

Error Response Format

All errors return a JSON object with the following structure:

json
{
  "error": {
    "message": "Human-readable error description",
    "type": "error_type_identifier",
    "code": "specific_error_code"
  }
}

Error Types and Codes

Error TypeError CodeHTTP StatusDescription
authentication_errorinvalid_api_key401The provided API key is invalid
permission_errorinsufficient_quota403The API key has insufficient quota
invalid_request_errorinvalid_parameter400A parameter value is invalid
invalid_request_errorinvalid_json400The JSON is malformed
rate_limit_errorrate_limit_exceeded429Too many requests in a short period
server_errorinternal_error500Internal server error

Rate Limits

Rate limits are enforced per API key. Exceeding the limit returns a 429 status code.

SDK Compatibility

This API is designed to be compatible with:

  • OpenAI Python SDK (for /openai/ endpoints)
  • Anthropic Python SDK (for /anthropic/ endpoints)
  • Any HTTP client that supports the corresponding API format

Need help? Check the FAQ for common questions and troubleshooting.