The Delegation developer documentation#
Use the service navigation to find the AI Gateway, Platform API, and File Service references. Client guides contain runnable TypeScript, Python, and Go integrations.| Service | Production base URL | Authentication |
|---|
| AI Gateway | https://gateway.malcolmstone.io/v1 | Provisioned server-side gateway key |
| Platform API | https://delegation.malcolmstone.io/api | Live session token or cookie |
| File Service | https://delegation.malcolmstone.io/api/user-files | Live session token or cookie |
| Operations | Gateway health and Phoenix traces | Operator access for dashboards |
Gateway credentials belong in server processes. End users do not create gateway keys. Browser requests use /api/gateway/v1/... on the platform, which checks the session and attributes usage to the signed-in user. Secrets are injected from AWS Secrets Manager; no .env file is required.Choose a model#
claude-sonnet-4-6 is the default for agents. gemini-2.5-flash provides a Google alternative. The model prefix selects the provider automatically. Use GET /v1/models?provider=claude to filter discovery or GET /v1/models/{model} to inspect a model. The catalog describes adapter support; quota and upstream account availability can still affect requests.Embeddings use gemini-embedding-001 with 768 dimensions for platform documents. Images use gemini-2.5-flash-image. Speech uses aws-polly and transcription uses aws-transcribe with provider bedrock.Handle errors and streams#
Error responses use { "error": { "type": "...", "message": "...", "code": "..." } }. Keep the X-Request-ID response header when reporting failures. HTTP 429 includes Retry-After in seconds. Do not retry validation or authentication errors. Retrying a generation can incur another charge; there is no idempotency guarantee.Claude and Gemini streaming uses SSE. A successful stream ends with [DONE]. stream_options.include_usage=true adds a final usage event whose choices array is empty. After streaming begins, a provider failure arrives as an error event and does not emit [DONE]. Always handle SDK exceptions or StreamReader.Err().The supported surface is Chat Completions, not the Responses or Assistants APIs. Tool execution stays in your application: execute only approved tools, then return their results with the matching tool_call_id.Modified at 2026-10-20 19:24:00