Skip to content
Aurabase Logo
aurabase

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.

Headers#

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

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.

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.

Last updated · @aurabase/aurabase-js@0.7.5 · aura@0.3.4↗ Report a problem