Create a chat completion (stateless)
POST/api/v1/chat/completions
OpenAI Chat Completions-compatible endpoint. Mirrors OpenAI's POST /v1/chat/completions path so an OpenAI SDK can target it by base URL alone. Resolves the AI provider from ai_provider_id, decrypts its secret, and calls the appropriate Vercel AI SDK provider. ai_provider_id is required — there is no server-side model fallback.
Request
Responses
- 200
- 400
- 401
- 404
Chat completion result (JSON or SSE stream)
Bad Request — messages is missing or empty, or ai_provider_id is missing
Unauthorized — missing or invalid bearer token
AI provider not found