Request
Body
OpenAI SDK
This endpoint offers compatibility with the OpenAI SDKs to support developers and their apps with minimal changes. Once you update the base URL, you can start using the SDKs to make calls to Modelslab with API key.Import the package
pip install openai
Python code
Response
Authorizations
Bearer token authentication using ModelsLab API key
Body
Array of chat messages with role and content
Model to use for chat completion
Maximum number of tokens allowed in the response
1 <= x <= 44000
Sampling temperature for randomness
0 <= x <= 2
Nucleus sampling parameter
0 <= x <= 1
Presence penalty for token repetition
-2 <= x <= 2
Frequency penalty for token repetition
-2 <= x <= 2
Whether to stream back partial progress
Response
Chat completion response
Unique identifier for the chat completion
Object type
chat.completion
Unix timestamp of creation
Model used for generation
Array of completion choices
Token usage information
Log probabilities for prompt tokens