Endpoint
base_url to https://api.viviai.cc/v1. The SDK appends /chat/completions.
Authentication
YOUR_OPENAI_MODEL with an available Chat Completions model ID.
Request parameters
*Tool-only assistant messages can use a different structure. Some older models require
max_tokens instead of max_completion_tokens; do not send both. Tool calling, multimodal input, reasoning, and structured output depend on the model and channel.
Request examples
SetVIVI_API_KEY to your ViVi-API key in your shell environment. See Quickstart to create a key. Install the SDK with python -m pip install openai. cURL uses Bash syntax.
Response
Illustrative response; text and usage numbers are examples:- Text:
choices[0].message.content. - Finish reason:
choices[0].finish_reason.stopusually means normal completion;lengthmeans the output limit was reached. - Usage:
usage. Exact fields and billing rules depend on the actual response and dashboard.
Multi-turn conversations
Send the relevant conversation history with each request. The API key does not automatically associate requests with a conversation.Streaming
data: event and read choices[0].delta.content. Some events only carry a role or finish reason. A common final marker is data: [DONE].
Integration notes
- Include
/v1only once in the final URL. - Specialized image and other models may not support this endpoint.
- If parameters fail, start with only
modelandmessages. - See troubleshooting for authentication, permission, and rate-limit errors.