Endpoint Examples
Chat completion using G4F Endpoint
Sends a request for chat completions using the g4f library
POST
v1
/
gpt4free
Request Body
messages
array
requiredArray of messages to send to the chat model.
model
string
default: "gpt-4o"The model could be gpt-40
, gpt-3.5-turbo
or gpt-4
stream
boolean
Whether to stream the response or not.
timeout
int
timeout for the response to be sent.
shuffle
boolean
default: "false"Shuffle the providers used for the chat completions. More details here
image_url
string
Include image for vision processing using the google gemini-pro model.
200 - Successful chat completion response
response
string
Response Text.
400 - Error message
error
string
The error message explaining what went wrong.
Was this page helpful?