Skip to main content
The OpenAI Chat Completions API endpoint lets you send chat messages and receive AI-generated responses using the familiar OpenAI request format. You can use GPT, Claude, and Gemini models through this single endpoint, making it easy to switch between model families without changing your integration code. Base URL: http://apillm.globalaiopc.com/gw_llm_power Endpoint: POST /v1/chat/completions

Authentication

Authenticate every request using the Authorization header with your API key:

Supported Models

GPT Models

Claude Models

Gemini Models

Model Suffix Reference

Multimodal Support

Request Parameters

string
required
The name of the model to use. For example: gpt-5.4, claude-opus-4-7, or gemini-3.1-pro-preview.
array
required
An array of chat message objects forming the conversation history. Each object must include a role and content field.
string
required
The role of the message author. Accepted values: system, user, or assistant.
string | array
required
The content of the message. Pass a plain text string for standard text input, or an OpenAI-compatible multimodal array for image or video analysis.
number
Controls the randomness of the model’s output. Values range from 0 to 2. Lower values produce more focused, deterministic responses; higher values produce more varied output. We recommend adjusting either temperature or top_p, but not both simultaneously.
number
Nucleus sampling parameter. The model considers only the tokens comprising the top top_p probability mass. We recommend adjusting either top_p or temperature, but not both simultaneously.
boolean
When set to true, the response is returned as a stream of Server-Sent Events (SSE). The stream ends with a final data: [DONE] message.
integer
The maximum number of tokens the model may generate in its response.
string | array
One or more sequences at which the model will stop generating further tokens. Pass a single string or an array of up to four strings.

Response Fields

string
A unique identifier for the request.
string
The type of the returned object. Always chat.completion for non-streaming responses.
integer
The Unix timestamp (in seconds) of when the response was created.
string
The name of the model that was used to generate the response.
string
The role of the generated message. Always assistant.
string
The text content generated by the model.
string
The reason the model stopped generating tokens. Common values include stop (natural end) and length (token limit reached).
integer
The number of tokens in the input messages.
integer
The number of tokens in the generated response.
integer
The total number of tokens used in the request (prompt + completion).

Code Examples

Example Response

To receive a streaming response, set "stream": true in your request body. The API will return a series of Server-Sent Events (SSE), each containing a partial response delta. The stream terminates with a final data: [DONE] message.