Skip to content

Token Switch AI Gateway Platform Model API Documentation ​

1. Overview ​

Token Switch AI Gateway Platform is a unified AI service forwarding and management platform for large model application scenarios, primarily used to connect and distribute multiple mainstream large model ecosystems, including ChatGPT, Claude, Gemini, etc. Through Token Switch, developers can call different models with a unified interface, simplify integration costs, improve calling efficiency, and achieve more flexible model selection.

1.1. Platform Introduction ​

  • Model Call Base URL: https://neolink.com/api
  • Model Call API Key: xxxxxxxx

1.2. Authentication ​

All API requests require an API Key to be included in the HTTP Header for authentication:

http
Authorization: Bearer <API Key>

Note: Some models (such as the Google series) may not recognize the Authorization parameter. In such cases, you can use x-goog-api-key to pass authentication information:

http
x-goog-api-key: <API Key>

1.3. General Request Format ​

  • All APIs use HTTPS protocol
  • Request body format is application/json (some upload APIs use multipart/form-data)
  • Character encoding is always UTF-8
  • The {apiUrl} in the request path must be replaced with the actual Base URL

1.4. General Response Format ​

Most APIs return standard JSON responses with the following common fields:

FieldTypeDescription
idstringUnique identifier of the request
objectstringType of the returned object
createdintegerCreation timestamp (seconds)
modelstringID of the model used
choicesarrayList of returned results (chat APIs)
dataarray/objectReturned data (image, audio, and other APIs)
usageobjectToken usage information

Response formats may differ across different model protocols. Please refer to the specific API documentation for details.

1.5. Error Codes ​

The following are general HTTP status codes only. Different models may have additional business error codes. Please refer to the specific API documentation. For more business error codes, see User Error Code Guide.

HTTP status codes and their meanings:

Status CodemessageMeaning
400"Invalid request parameters. Please check and try again."The request format is incorrect or cannot be understood by the server. Usually means a client error.
401"API Key is invalid or unavailable. Please check and try again."API key verification failed. Please check if your API Key is correct or if the token has expired.
402"Insufficient balance or quota. Please top up or adjust your budget and try again."Insufficient account balance or quota to complete this request.
403"Your account or API Key does not have permission. Please check your configuration and try again."Insufficient permissions, the server refused to execute the request.
404"The model or endpoint is currently unavailable. Please check and try again."The requested resource was not found. You may be accessing a non-existent endpoint.
406"The request content does not meet requirements."The server cannot generate a response matching the content characteristics specified by the client.
408"Request timed out. Please try again later."The server timed out waiting for the client request.
413"Input is too long or the file is too large."The request body is too large, exceeding the maximum length allowed by the server.
422"The request content cannot be processed."The request format is correct but semantically invalid, and the server cannot process it.
429"Too many requests. Please try again later."Rate limit exceeded due to too frequent requests.
500"Request processing failed. Please try again later; if this persists, contact the platform administrator."Internal server error.
502"The upstream service returned an error."The gateway received an invalid response from the upstream server.
503"The service is temporarily unavailable."The server is temporarily unavailable. This may be due to server maintenance or high load.
504"Service response timed out."The gateway timed out waiting for the upstream server to respond.
524"Request processing is taking longer than expected."The gateway connection to the upstream was established, but the upstream did not return a complete response within the specified time.
529"Service load is high. Please try again later."The service load is too high to process requests temporarily.