Overview
This endpoint provides text to text functionality.
Authentication
This endpoint requires authentication using a Bearer token.
Authorization
string
default:"sk-***********"
required
Your API key in the format: YOUR_API_KEY
Request Body
model
string
default:"gemini-2.0-flash"
required
The model to use for the request. gemini-2.0-flash
Array of message objects for the conversation
- role:user,The role of the message.
- role:assistant,The role of the message.
- role:system,The role of the message.
- type:text,The positive prompt for the generation.
Whether to stream the response
Request Example
curl -X POST "https://gptproto.com/v1/chat/completions" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.0-flash",
"messages": [
{
"role": "user",
"content": "Who are you?"
}
],
"stream": false
}'
Response
Error Responses
{
"error": {
"message": "Invalid signature",
"type": "401"
}
}