Gemini clients
Meadow serves Google’s own Gemini API shape: generateContent and streamGenerateContent. Point gemini-cli or a Google GenAI SDK at Meadow, give it a Meadow key, and your stored google or vertex key serves the call. The request and the response stay in Google’s format. Meadow converts nothing between this format and the other three.
Next step: store a google key (Provider keys), then run the curl call below.
Not on the hosted beta yet. This route arrives with the hosted beta’s next update. On 2026-11-28 it was run against Google AI Studio from a local server built from the same code: blocking, streamed, on a key with a dollar limit, and from gemini-cli. It was not run against Vertex.
Paths
The Google GenAI SDKs call v1 unless you set another API version. Google’s own REST examples use v1beta. Meadow calls Google AI Studio with the version you used, and Vertex with v1. Google’s v1 answered 404 for gemini-3-flash-preview, which v1beta served, so use v1beta for preview models.
The stream needs ?alt=sse, which the SDKs and gemini-cli send. Without it Meadow answers 400.
Your key
Send your Meadow key in a header. These two are the recommended forms:
- the
x-goog-api-keyheader, where gemini-cli and the GenAI SDKs send it; Authorization: Bearer <key>.
Meadow also accepts the key query parameter, because Google’s REST examples use it. Avoid it: query strings end up in proxy, browser and server logs, including logs Meadow does not control. Meadow removes the key from the query before it logs anything, records usage or calls the vendor, and no answer repeats the request URL.
If you send the key in more than one place, every copy must be the same key. An empty x-goog-api-key counts as no key.
The vendor gets your stored key, never your Meadow key: the google key in x-goog-api-key, or a token made from the vertex service account. If a vendor’s error names that stored key or token, in an error body or in a stream’s error event, Meadow replaces it with [REDACTED].
Model ids
{model} is a Meadow model id, as on the other routes:
gemini-3.8-flash, or any Gemini id fromGET /v1/models, goes togooglefirst and thenvertex, when you have both keys;google/gemini-3.8-flashpins Google AI Studio;vertex/gemini-3.8-flashpins Vertex, which Meadow calls atpublishers/google/models/gemini-3.8-flash.
GET /v1/models lists generate_content in formats for every provider that serves this route. Claude, GPT and Grok models have no provider for this format and get a 400.
curl
The answer is Google’s GenerateContentResponse as Google sent it, with the x-meadow-provider, x-meadow-model and x-meadow-attempts headers added.
gemini-cli
gemini-cli reads GOOGLE_GEMINI_BASE_URL and sends its key in x-goog-api-key. With that variable set, gemini-cli 0.71.1 chooses an auth type it then refuses (“Invalid auth method selected.”), so also select the API key type in ~/.gemini/settings.json:
That run, against a local server, made one streamed v1beta call. Its system prompt made it 8,414 input tokens. It cost 0.00421 USD at Google’s list price.
Google GenAI SDK
Python:
Use the SDK in Gemini API mode. Vertex mode (vertexai=True) calls other paths, which Meadow does not serve. To reach Vertex, keep Gemini API mode and pin vertex/<model>.
Limits and spend
The route goes through the same checks as the other model routes:
allowed_modelsandallowed_providersapply to{model}and the providers that could serve it.- A key with a token limit or a dollar limit needs
generationConfig.maxOutputTokens. Meadow estimates a call as its body size divided by 3, plusmaxOutputTokenstimescandidateCount. - A dollar limit, or a budget with
hard_limit, refuses a call that Meadow cannot price before it is sent, with 403key_spend_price_unknown. Meadow has no Vertex prices, so in a project with both keys, pingoogle/<model>on such a key. - Project routing applies. The body is Google’s, so this route does not read Meadow’s request fields
modelsandprovider.
Usage and cost
Usage records show format generate_content. Meadow reads usageMetadata:
Google bills thinking tokens as output. On a stream the counts add up, and Meadow keeps the last chunk’s.
A live call to gemini-3-flash-preview with maxOutputTokens 64 and a short arithmetic prompt came back with finishReason MAX_TOKENS and this usage:
Its usage record read 33 input tokens, 60 output tokens (2 + 58), 58 reasoning tokens, cost_status price_table and cost 0.0001965 USD. The thinking stayed inside maxOutputTokens, so the reservation Meadow held for a key with a dollar limit (133 tokens at the model’s highest rate) covered the charge. That is one model on one day. Google’s reference does not promise it for every model. A call that used Google Search or Maps grounding, or carried audio, is stored with no cost and a reason, because Meadow has no price for it. A Vertex call is stored with its tokens and no cost (provider_not_priced).
Errors
A Google error is passed through with Google’s status and body. An error Meadow makes on this route is in Google’s envelope:
code is the HTTP status and status its Google name. reason is Meadow’s error code in upper case, and metadata.code holds it as written in Errors. The list of attempts is not in this envelope. Read x-meadow-route for where the call went.
Not served
Meadow answers these in Google’s error envelope and never passes them to a vendor:
Tuned models and the Interactions API are not served either. Google’s model list is not served: GET /v1beta/models gets a 404, and GET /v1/models answers with Meadow’s own list in OpenAI’s shape, which a Gemini client cannot read. Call Google directly for these. See Known limits.
API reference
Operations on this page: generateContent, streamGenerateContent.