1. Documentation
The Delegation
  • Documentation
    • Getting started
    • TypeScript client
    • Python client
    • Go client
    • Operations and observability
  • AI Gateway
    • Chat
      • Create a chat completion
    • Embeddings
      • Create text embeddings
    • Audio
      • Transcribe audio with AWS Transcribe
      • Text-to-speech
    • Images
      • Generate images with Gemini
    • Models
      • List available models
      • Retrieve a model
    • Users
      • List all users
      • Create a user
      • Get a user
      • Delete a user
      • Get user usage and cost summary
    • Health
      • Liveness / readiness probe
      • Provider health check
      • Gateway info
    • Admin
      • Per-provider request metrics
      • List configured providers
    • Schemas
      • ContentPartText
      • ContentPartImageURL
      • ContentPartAudio
      • ContentPartVideo
      • ContentPartDocument
      • ContentPart
      • FunctionDef
      • Tool
      • ToolCall
      • ChatMessage
      • ChatRequest
      • Usage
      • Choice
      • ChatResponse
      • EmbeddingsRequest
      • EmbeddingObject
      • EmbeddingsResponse
      • TranscriptionResponse
      • TTSRequest
      • ImageGenerationRequest
      • ImageData
      • ImageGenerationResponse
      • ModelInfo
      • ModelList
      • UsageRecord
      • User
      • UserUsageSummary
      • ProviderHealth
      • HealthResponse
      • ProviderMetrics
      • MetricsResponse
      • ErrorDetail
      • ErrorResponse
  • Platform API
    • Projects
      • List projects
      • Create project
      • Get project
      • Update project
      • Delete project
    • Tasks
      • Create task
      • Get task
      • Update task
    • Conversations
      • Get conversation
      • Clear conversation
      • Send message
    • Keys
      • Gateway usage statistics
    • Account
      • Get account
      • Update account role
      • Delete account
    • Schemas
      • Error
      • ChatMessage
      • ToolDefinition
      • ToolCall
      • ChatCompletionRequest
      • ChatCompletionResponse
      • EmbeddingRequest
      • ImageGenRequest
      • Project
      • Task
      • Message
      • Conversation
      • UserFile
      • GatewayKey
      • User
      • UserBalance
      • AuthSession
      • Session
  • File Service
    • Files
      • List files
      • Upload file
      • Update file
      • Delete / trash file
      • Restore file from trash
    • Schemas
      • Error
      • ChatMessage
      • ToolDefinition
      • ToolCall
      • ChatCompletionRequest
      • ChatCompletionResponse
      • EmbeddingRequest
      • ImageGenRequest
      • Project
      • Task
      • Message
      • Conversation
      • UserFile
      • GatewayKey
      • User
      • UserBalance
      • AuthSession
      • Session
  1. Documentation

Go client

From apps/gateway/sdk, run go run ./example/quickstart. For another Go module, add a local replace gateway/sdk => /absolute/path/to/apps/gateway/sdk; this module is included in the repository, not published under a public module path.
Inject GATEWAY_API_KEY from your secret manager. Optionally set GATEWAY_BASE_URL to the gateway URL ending in /v1. This is a server-side integration; do not put the gateway key in browser code. The examples make billable requests.
Switch the chat model to gemini-2.5-flash to use Gemini. No provider parameter is required. Treat model, token-limit, and authentication errors as configuration problems; use the response request ID for support.
Modified at 2026-10-20 19:24:15
Previous
Python client
Next
Operations and observability
Built with