Aurabase Logo
aurabasedocs
Aurabase Logo
aurabasedocs
API/AI Gateway/Chat completion & streaming

Chat completion & streaming

POST/v1/ai/{project_id}/chat

Proxies chat completions to OpenAI, Anthropic Claude, and Google Gemini with prompt injection defenses and automated fallback.

#
Request

Headers

HeaderRequiredValue
apikeyyesProject public anon key or private service_role key
AuthorizationnoBearer <user_jwt>
Content-Typeyesapplication/json
Acceptnotext/event-stream (when calling /chat/stream)
#
Request

Parameters

ParameterTypeRequiredDescription
messagesChatMessage[]yesArray of conversation turns. Only roles user and assistant are permitted.
systemstringnoSystem prompt instructing the model. Composed automatically with project-level prompt.
providerstringnoTarget LLM provider (anthropic, openai, google). Defaults to project setting.
modelstringnoProvider model identifier (e.g., claude-3-5-sonnet, gpt-4o).
temperaturenumbernoSampling temperature (0.0 to 1.0).
max_tokensnumbernoMaximum output tokens generated.
#
Security

Prompt Injection Protection

Info

System messages are strictly forbidden inside the messages array (validate_roles). They must be passed via the system parameter. The server concatenates the project's administrator-configured system_prompt ahead of any user-supplied prompt, guaranteeing that platform policies cannot be overridden by user requests.

v1.0 · revised Oct 31, 2026