Chat Completions API
The Chat Completions API is the standard interface for interacting with language models in a conversational format. It is compatible with the OpenAI Chat Completions API, making it easy to migrate existing code. This API is ideal for most text-based conversational use cases.
Note: Latest guidelines recommend moving towards the Responses API for more advanced features. We currently do not support this, but will support it shortly.
See the official OpenAI documentation for the most up to date documentation.
Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.ncompass.tech/v1",
api_key="YOUR_API_KEY",
)
completion = client.chat.completions.create(
model="meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",
messages=[
{"role": "user", "content": "Hello!"}
],
# stream = True # Set for streaming vs non-streaming
)
print(completion.choices[0].message)
Last updated on