Request
curl
Body
json
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.1
Import the package
You can import the OpenAI python package into your python application and change the base URL and API key.
pip install openai
2
Python code
python
3
Response
json
Authorizations
Bearer token authentication using ModelsLab API key
Body
application/json
Prompt(s) to generate completions for
Model to use for completion
Maximum number of tokens allowed in the response
Required range:
1 <= x <= 44000
Sampling temperature for randomness
Required range:
0 <= x <= 2
Nucleus sampling parameter
Required range:
0 <= x <= 1
Presence penalty for token repetition
Required range:
-2 <= x <= 2
Frequency penalty for token repetition
Required range:
-2 <= x <= 2
Whether to stream back partial progress
Stop sequences to end generation