Chat Completions
Overview
This documentation provides instructions on how to use the Chat Completions API endpoint. The API allows you to generate chat completions based on provided messages and parameters.
Base URL
Endpoint
Authentication
The API uses Bearer Token authentication. You must include your API key in the Authorization
header of each request.
Replace YOUR_API_KEY
with your actual API key.
Request Format
The request should be sent as a POST request with a JSON body.
Headers
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
Body Parameters
Message Object
Each message in the messages
array should have the following structure:
Example Request
Response Format
The API returns a JSON response with the generated completion.
Response Fields
Choice Object
Message Object
Usage Object
Example Response
Error Responses
The API may return error responses in the following format:
Common error status codes:
400: Bad Request - Invalid input parameters
401: Unauthorized - Invalid or missing API key
500: Internal Server Error
Example cURL Request
Here's an example of how to make a request using cURL:
Replace YOUR_API_KEY
with your actual API key.
Support
If you encounter any issues or have questions about the API, please contact our support team at support@upchatty.com.
Last updated