Skip to main content
Gemini CLI connects to Orq.ai through the Google Generative Language-compatible endpoint. Keep native streaming and function calling while applying AI Gateway tracing, cost tracking, policies, and access controls.

Prerequisites

Connect Gemini CLI

1

Install Gemini CLI

2

Configure the endpoint and API key

Set the Orq.ai API key as GEMINI_API_KEY, then point Gemini CLI at the Google-compatible AI Gateway endpoint:
Replace <ORQ_API_KEY> with a key from Workspace Settings > API Keys.
3

Start Gemini CLI

If prompted, select Gemini API Key as the authentication method.If gemini -p reports Invalid auth method selected, add the authentication method to ~/.gemini/settings.json:
Send a prompt that reads a file or invokes another tool to verify streaming and function calling.

Connect Google Gen AI SDKs

Interactions API

Use the Interactions API for new model integrations. It provides a unified input and output format for model requests through client.interactions.create. The gateway supports model interactions with text and image input, function tools and results, streaming, stored continuation, background execution, cancellation, and deletion. Managed agents, provider-hosted built-in tools, and non-text output modalities are not supported.
Gemini CLI continues to use the generateContent compatibility surface.
Exact last_event_id resume requires an interaction that was created with stream: true.

generateContent compatibility

Set the SDK base URL to https://my.orq.ai/v3/google. The SDK appends the /v1beta/models/... path.
Use a bare gemini-* model ID or any provider/model identifier enabled in the workspace. Find available identifiers in supported models.
Gemini models with thinking enabled count thinking tokens toward maxOutputTokens. Set thinkingConfig.thinkingBudget to 0 to disable thinking on supported models.

Verification

Run a prompt, then open Orq.ai Traces. Confirm the trace records the selected model and the workspace associated with the API key.