Chat Completions API
The /v1/chat/completions endpoint is your gateway to intelligent, context-aware conversations. Whether you're building a chatbot, virtual assistant, or automated support system, this API lets you interact with AI models that understand and respond naturally to user messages.
Pro Tip: Use this endpoint not only for generating replies but also for prevention and detection of sensitive or unwanted content.
How It Works
Messages are sent as an array of objects:
role: Defines the sender of the message (user,system,assistant).content: The text of the message itself.
This structure allows the AI to:
- Maintain conversation context across multiple turns.
- Apply prevention rules to block unsafe or restricted content.
- Trigger detection algorithms to flag potential policy violations.
Note: Prevention & detection run in real-time, giving your app instant control over AI outputs.
Authentication & Security
- All requests require an API key in the
Authorizationheader:Authorization: Bearer YOUR_API_KEY