https://api.withhopper.com/v1 and request model gemma-4-31b; the context window is 25,000 tokens. TTFT is ~37 ms on short prompts, measured from us-west-2 with cold unique prompts on a keyed connection.
Make a request
/v1/* routes, such as GET /v1/models and POST /v1/completions, are forwarded the same way.
Streaming
Passstream: true and the response arrives as SSE chunks in the OpenAI format.
stream_options.include_usage, the gateway injects it upstream, reads the usage chunk for billing, and strips it from your stream. Set stream_options: {"include_usage": true} yourself and the usage chunk is delivered to you as the final data event.
Spend headers differ between the two modes because a stream’s cost is unknown until it ends:
Tool calling and structured outputs
Tool calling and structured outputs are enabled ongemma-4-31b. Define tools in the OpenAI format:
response_format for structured outputs passes through the same way.
Keep one warm connection
Every turn of a voice agent makes an LLM request, and a fresh TCP + TLS handshake adds multiple round trips to that turn — the default OpenAI client pays it repeatedly, because its 5 s keepalive lapses in normal conversational gaps.hopper-client is a drop-in replacement with an httpx transport tuned for voice:
Measured against the same endpoint, these defaults roughly halve median TTFT; the numbers and benchmark script are in the client post.
Create the client once, at startup, and reuse it for every turn.