# The Delegation ## Docs - Root [Getting started](https://docs.delegation.malcolmstone.io/getting-started-2489778m0.md): - Root [TypeScript client](https://docs.delegation.malcolmstone.io/typescript-client-2489779m0.md): - Root [Python client](https://docs.delegation.malcolmstone.io/python-client-2489780m0.md): - Root [Go client](https://docs.delegation.malcolmstone.io/go-client-2489781m0.md): - Root [Operations and observability](https://docs.delegation.malcolmstone.io/operations-and-observability-2489782m0.md): ## API Docs - Root > Chat [Create a chat completion](https://docs.delegation.malcolmstone.io/create-a-chat-completion-45649978e0.md): Create a chat completion. Model IDs infer the provider; no provider extension is needed for standard clients. Claude and Gemini support tool calls and streaming. For streams, failures before the first event return HTTP 502; failures after output begins emit a data event with an error envelope and no [DONE]. Treat incomplete streams as failures. Request IDs are returned in headers. Usage and cost attribution use server-controlled X-User-ID and optional session headers. - Root > Embeddings [Create text embeddings](https://docs.delegation.malcolmstone.io/create-text-embeddings-45649979e0.md): Generate Gemini embeddings. Use dimensions=768 for the platform document index; do not mix vectors from different models. - Root > Audio [Transcribe audio with AWS Transcribe](https://docs.delegation.malcolmstone.io/transcribe-audio-with-aws-transcribe-45649980e0.md): Transcribe an uploaded audio file through AWS Transcribe. Provider is bedrock and model is aws-transcribe. - Root > Audio [Text-to-speech](https://docs.delegation.malcolmstone.io/text-to-speech-45649981e0.md): Synthesise speech from text using the OpenAI TTS API. - Root > Images [Generate images with Gemini](https://docs.delegation.malcolmstone.io/generate-images-with-gemini-45649982e0.md): Generate one Gemini image (n=1). Returns base64 PNG; response_format=url returns a data URL. Size selects an aspect ratio. - Root > Models [List available models](https://docs.delegation.malcolmstone.io/list-available-models-45649983e0.md): Lists the gateway adapter catalog for configured providers, sorted by model ID. Catalog membership does not guarantee account quota or upstream availability. - Root > Models [Retrieve a model](https://docs.delegation.malcolmstone.io/retrieve-a-model-45649984e0.md): - Root > Users [List all users](https://docs.delegation.malcolmstone.io/list-all-users-45649986e0.md): - Root > Users [Create a user](https://docs.delegation.malcolmstone.io/create-a-user-45649987e0.md): Creates a gateway user. Pass `X-User-ID: ` on chat requests to - Root > Users [Get a user](https://docs.delegation.malcolmstone.io/get-a-user-45649988e0.md): - Root > Users [Delete a user](https://docs.delegation.malcolmstone.io/delete-a-user-45649989e0.md): - Root > Users [Get user usage and cost summary](https://docs.delegation.malcolmstone.io/get-user-usage-and-cost-summary-45649990e0.md): Returns aggregate token counts, total USD spend, and all individual - Root > Health [Liveness / readiness probe](https://docs.delegation.malcolmstone.io/liveness-readiness-probe-45649991e0.md): Returns 200 immediately without any I/O. Used by the Kubernetes - Root > Health [Provider health check](https://docs.delegation.malcolmstone.io/provider-health-check-45649992e0.md): Probes all configured providers concurrently (10 s timeout). - Root > Health [Gateway info](https://docs.delegation.malcolmstone.io/gateway-info-45649993e0.md): Returns gateway metadata and the full endpoint list. - Root > Admin [Per-provider request metrics](https://docs.delegation.malcolmstone.io/per-provider-request-metrics-45649994e0.md): Operator-only endpoint. Requires an approved network address and an administrator session in addition to a gateway key. - Root > Admin [List configured providers](https://docs.delegation.malcolmstone.io/list-configured-providers-45649995e0.md): Operator-only endpoint. Requires an approved network address and an administrator session in addition to a gateway key. - Root > Projects [List projects](https://docs.delegation.malcolmstone.io/list-projects-45649996e0.md): Returns all projects owned by the authenticated user, newest first. - Root > Projects [Create project](https://docs.delegation.malcolmstone.io/create-project-45649997e0.md): - Root > Projects [Get project](https://docs.delegation.malcolmstone.io/get-project-45649998e0.md): - Root > Projects [Update project](https://docs.delegation.malcolmstone.io/update-project-45649999e0.md): Partial update — pass only the fields to change. - Root > Projects [Delete project](https://docs.delegation.malcolmstone.io/delete-project-45650000e0.md): Permanently deletes the project and all child data. - Root > Tasks [Create task](https://docs.delegation.malcolmstone.io/create-task-45650001e0.md): - Root > Tasks [Get task](https://docs.delegation.malcolmstone.io/get-task-45650002e0.md): - Root > Tasks [Update task](https://docs.delegation.malcolmstone.io/update-task-45650003e0.md): - Root > Conversations [Get conversation](https://docs.delegation.malcolmstone.io/get-conversation-45650004e0.md): Returns the conversation with all messages, ordered chronologically. - Root > Conversations [Clear conversation](https://docs.delegation.malcolmstone.io/clear-conversation-45650005e0.md): Deletes all messages in the conversation. The conversation object is preserved. - Root > Conversations [Send message](https://docs.delegation.malcolmstone.io/send-message-45650006e0.md): - Root > Keys [Gateway usage statistics](https://docs.delegation.malcolmstone.io/gateway-usage-statistics-45650007e0.md): Returns total tokens, total cost (USD), and per-request usage records. - Root > Account [Get account](https://docs.delegation.malcolmstone.io/get-account-45650008e0.md): Returns the DB user record for the authenticated session. Auto-provisions a row if this is the first login. - Root > Account [Update account role](https://docs.delegation.malcolmstone.io/update-account-role-45650009e0.md): Switch between `user` and `developer` account types. Users may only switch to roles in the self-switchable set. - Root > Account [Delete account](https://docs.delegation.malcolmstone.io/delete-account-45650010e0.md): Soft-deletes the authenticated user's account (sets `deleted_at`). The session is revoked server-side; discard the tokens client-side. - Root > Files [List files](https://docs.delegation.malcolmstone.io/list-files-45650011e0.md): Returns active files. Add `?trash=1` to list soft-deleted files. - Root > Files [Upload file](https://docs.delegation.malcolmstone.io/upload-file-45650012e0.md): Multipart form upload. Max 50 MB per file. - Root > Files [Update file](https://docs.delegation.malcolmstone.io/update-file-45650013e0.md): Rename a file or toggle its public/private visibility. - Root > Files [Delete / trash file](https://docs.delegation.malcolmstone.io/delete-trash-file-45650014e0.md): Soft-deletes the file (recoverable within 30 days). Add `&permanent=1` to permanently delete immediately. - Root > Files [Restore file from trash](https://docs.delegation.malcolmstone.io/restore-file-from-trash-45650015e0.md): ## Schemas - Root [ContentPartText](https://docs.delegation.malcolmstone.io/contentparttext-18378027d0.md): - Root [ContentPartImageURL](https://docs.delegation.malcolmstone.io/contentpartimageurl-18378028d0.md): - Root [ContentPartAudio](https://docs.delegation.malcolmstone.io/contentpartaudio-18378029d0.md): - Root [ContentPartVideo](https://docs.delegation.malcolmstone.io/contentpartvideo-18378030d0.md): - Root [ContentPartDocument](https://docs.delegation.malcolmstone.io/contentpartdocument-18378031d0.md): - Root [ContentPart](https://docs.delegation.malcolmstone.io/contentpart-18378032d0.md): - Root [FunctionDef](https://docs.delegation.malcolmstone.io/functiondef-18378033d0.md): - Root [Tool](https://docs.delegation.malcolmstone.io/tool-18378034d0.md): - Root [ToolCall](https://docs.delegation.malcolmstone.io/toolcall-18378035d0.md): - Root [ChatMessage](https://docs.delegation.malcolmstone.io/chatmessage-18378036d0.md): - Root [ChatRequest](https://docs.delegation.malcolmstone.io/chatrequest-18378037d0.md): - Root [Usage](https://docs.delegation.malcolmstone.io/usage-18378038d0.md): - Root [Choice](https://docs.delegation.malcolmstone.io/choice-18378039d0.md): - Root [ChatResponse](https://docs.delegation.malcolmstone.io/chatresponse-18378040d0.md): - Root [EmbeddingsRequest](https://docs.delegation.malcolmstone.io/embeddingsrequest-18378041d0.md): - Root [EmbeddingObject](https://docs.delegation.malcolmstone.io/embeddingobject-18378042d0.md): - Root [EmbeddingsResponse](https://docs.delegation.malcolmstone.io/embeddingsresponse-18378043d0.md): - Root [TranscriptionResponse](https://docs.delegation.malcolmstone.io/transcriptionresponse-18378044d0.md): - Root [TTSRequest](https://docs.delegation.malcolmstone.io/ttsrequest-18378045d0.md): - Root [ImageGenerationRequest](https://docs.delegation.malcolmstone.io/imagegenerationrequest-18378046d0.md): - Root [ImageData](https://docs.delegation.malcolmstone.io/imagedata-18378047d0.md): - Root [ImageGenerationResponse](https://docs.delegation.malcolmstone.io/imagegenerationresponse-18378048d0.md): - Root [ModelInfo](https://docs.delegation.malcolmstone.io/modelinfo-18378049d0.md): - Root [ModelList](https://docs.delegation.malcolmstone.io/modellist-18378050d0.md): - Root [UsageRecord](https://docs.delegation.malcolmstone.io/usagerecord-18378051d0.md): - Root [User](https://docs.delegation.malcolmstone.io/user-18378052d0.md): - Root [UserUsageSummary](https://docs.delegation.malcolmstone.io/userusagesummary-18378053d0.md): - Root [ProviderHealth](https://docs.delegation.malcolmstone.io/providerhealth-18378054d0.md): - Root [HealthResponse](https://docs.delegation.malcolmstone.io/healthresponse-18378055d0.md): - Root [ProviderMetrics](https://docs.delegation.malcolmstone.io/providermetrics-18378056d0.md): - Root [MetricsResponse](https://docs.delegation.malcolmstone.io/metricsresponse-18378057d0.md): - Root [ErrorDetail](https://docs.delegation.malcolmstone.io/errordetail-18378058d0.md): - Root [ErrorResponse](https://docs.delegation.malcolmstone.io/errorresponse-18378059d0.md): - Root [Error](https://docs.delegation.malcolmstone.io/error-18378060d0.md): - Root [ChatMessage](https://docs.delegation.malcolmstone.io/chatmessage-18378061d0.md): - Root [ToolDefinition](https://docs.delegation.malcolmstone.io/tooldefinition-18378062d0.md): - Root [ToolCall](https://docs.delegation.malcolmstone.io/toolcall-18378063d0.md): - Root [ChatCompletionRequest](https://docs.delegation.malcolmstone.io/chatcompletionrequest-18378064d0.md): - Root [ChatCompletionResponse](https://docs.delegation.malcolmstone.io/chatcompletionresponse-18378065d0.md): - Root [EmbeddingRequest](https://docs.delegation.malcolmstone.io/embeddingrequest-18378066d0.md): - Root [ImageGenRequest](https://docs.delegation.malcolmstone.io/imagegenrequest-18378067d0.md): - Root [Project](https://docs.delegation.malcolmstone.io/project-18378068d0.md): - Root [Task](https://docs.delegation.malcolmstone.io/task-18378069d0.md): - Root [Message](https://docs.delegation.malcolmstone.io/message-18378070d0.md): - Root [Conversation](https://docs.delegation.malcolmstone.io/conversation-18378071d0.md): - Root [UserFile](https://docs.delegation.malcolmstone.io/userfile-18378072d0.md): - Root [GatewayKey](https://docs.delegation.malcolmstone.io/gatewaykey-18378073d0.md): - Root [User](https://docs.delegation.malcolmstone.io/user-18378074d0.md): - Root [UserBalance](https://docs.delegation.malcolmstone.io/userbalance-18378075d0.md): - Root [AuthSession](https://docs.delegation.malcolmstone.io/authsession-18378076d0.md): - Root [Session](https://docs.delegation.malcolmstone.io/session-18378077d0.md): - Root [Error](https://docs.delegation.malcolmstone.io/error-18378078d0.md): - Root [ChatMessage](https://docs.delegation.malcolmstone.io/chatmessage-18378079d0.md): - Root [ToolDefinition](https://docs.delegation.malcolmstone.io/tooldefinition-18378080d0.md): - Root [ToolCall](https://docs.delegation.malcolmstone.io/toolcall-18378081d0.md): - Root [ChatCompletionRequest](https://docs.delegation.malcolmstone.io/chatcompletionrequest-18378082d0.md): - Root [ChatCompletionResponse](https://docs.delegation.malcolmstone.io/chatcompletionresponse-18378083d0.md): - Root [EmbeddingRequest](https://docs.delegation.malcolmstone.io/embeddingrequest-18378084d0.md): - Root [ImageGenRequest](https://docs.delegation.malcolmstone.io/imagegenrequest-18378085d0.md): - Root [Project](https://docs.delegation.malcolmstone.io/project-18378086d0.md): - Root [Task](https://docs.delegation.malcolmstone.io/task-18378087d0.md): - Root [Message](https://docs.delegation.malcolmstone.io/message-18378088d0.md): - Root [Conversation](https://docs.delegation.malcolmstone.io/conversation-18378089d0.md): - Root [UserFile](https://docs.delegation.malcolmstone.io/userfile-18378090d0.md): - Root [GatewayKey](https://docs.delegation.malcolmstone.io/gatewaykey-18378091d0.md): - Root [User](https://docs.delegation.malcolmstone.io/user-18378092d0.md): - Root [UserBalance](https://docs.delegation.malcolmstone.io/userbalance-18378093d0.md): - Root [AuthSession](https://docs.delegation.malcolmstone.io/authsession-18378094d0.md): - Root [Session](https://docs.delegation.malcolmstone.io/session-18378095d0.md):