OpenAI compatibility#
The kluster.ai API is compatible with OpenAI's API and SDKs, allowing seamless integration into your existing applications.
If you already have an application running with the OpenAI client library, you can easily switch to kluster.ai's API with minimal changes. This ensures a smooth transition without the need for significant refactoring or rework.
Configuring OpenAI to use kluster.ai's API#
To start using kluster.ai with OpenAI's client libraries, set your API key and change the base URL to https://api.kluster.ai/v1
:
from openai import OpenAI
import json
client = OpenAI(
base_url="https://api.kluster.ai/v1",
api_key="INSERT_API_KEY", # Replace with your actual API key
)
Unsupported OpenAI features#
While kluster.ai's API is largely compatible with OpenAI's, the following sections outline the specific features and fields that are currently unsupported.
Chat completions endpoint#
When creating a chat completion via the POST https://api.kluster.ai/v1/chat/completions
endpoint, the following request parameters are not supported:
messages[].name
- attribute insystem
,user
, andassistant
type message objectsmessages[].refusal
- attribute inassistant
type message objectsmessages[].audio
- attribute inassistant
type message objectsmessages[].tool_calls
- attribute inassistant
type message objectsstore
n
modalities
response_format
service_tier
stream_options
tools
tool_choice
parallel_tool_calls
The following request parameters are deprecated:
messages[].function_call
- attribute inassistant
type message objectsmax_tokens
- usemax_completion_tokens
insteadfunction_call
functions
For more information on these parameters, refer to OpenAI's API documentation on creating chat completions.
Chat completion object#
The following fields of the chat completion object are not supported:
system_fingerprint
usage.completion_tokens_details
usage.prompt_tokens_details
For more information on these parameters, refer to OpenAI's API documentation on the chat completion object.