API styles
Choose a model, a provider route and a client API schema independently.
A model is a canonical identity, such as openai/gpt-image-2. A provider is the connection serving that model, with its own availability, capabilities, credentials and price card. An API style is the request and response schema your client uses. Selecting Google style does not change the provider to Google.
GET /v1/models returns provider routes with canonical_model and api_styles. Each style advertises its task, endpoints and supported streaming endpoints. GET /v1/ai/models groups routes by canonical identity. The playground selects the model first, then a provider serving it, then an available API style. A provider that does not serve a model cannot be selected for that model.
Send the route ID as model, or send a canonical model with X-AI-Provider: PROVIDER_ID. This header selects a Cloud route; callers cannot override upstream provider routing or credentials. Project model policies apply to the resolved route.
| Client style | Text endpoint | Image generation |
|---|---|---|
| OpenAI | /v1/chat/completions, /v1/responses | /v1/images/generations, /v1/images/edits |
/v1/google/generateContent, /v1beta/models/ROUTE_ID:generateContent | generateContent with image output | |
| Anthropic | /v1/messages or /v1/anthropic/messages | No native Anthropic image generation schema |
Use a Cloud project key in Authorization: Bearer .... The Google and Anthropic SDK-style x-goog-api-key and x-api-key headers also accept Cloud keys. Do not send multiple credential headers. These are Cloud credentials, not your upstream provider keys.
For example, send Anthropic-style text to a Google provider route:
{
"model": "google/gemini-3.1-pro-preview",
"system": "Be concise.",
"messages": [{"role": "user", "content": "Explain idempotency."}],
"max_tokens": 256
}Submit to /v1/messages with a stable Idempotency-Key. Cloud validates and translates the request into a reviewed native operation, settles against the original provider usage receipt, then presents an Anthropic-style response. Durable tasks use the same translation: send { "endpoint": "anthropic/messages", "body": ... } to /v1/ai/tasks.
Translated text supports user/assistant turns, text blocks, system instructions, maximum output tokens, temperature, top-p and supported stop sequences. Tools, cache controls, structured output settings and other provider-specific features require a native endpoint. Unsupported options are rejected before billing admission or submission. Translated requests are buffered; streaming remains available only on the advertised native streaming endpoints. This is a supported schema subset, not a promise that every SDK option is interchangeable.
Image translation uses reviewed size/aspect-ratio mappings. For example, 1536x1024 maps to Google 3:2 at 1K, and 2048x2048 maps to 1:1 at 2K. Google derives output pixels from its own resolution tier; this mapping does not promise identical pixel dimensions across providers. Unreviewed combinations are rejected. OpenAI transparency, output format, quality and masks are not silently discarded when switching to a Google route. Native controls remain available only where the provider and model support them.
See the executable Google and OpenAI speech examples. Google TTS can also use OpenAI /v1/audio/speech with a reviewed Google voice name and response_format: "wav". Cloud returns a bounded WAV response after settlement. A TTS route advertising styleDirection also accepts one delivery style in instructions, up to its maxChars. MP3, speed changes and multiple speakers require a native capability and are rejected on this translated endpoint. Video, embeddings and live transcription currently expose their reviewed native styles. Google TTS routes advertise their reviewed voices and support up to two speakers in native Google requests. Routes advertising voiceCreation also accept project-created voice_air_... IDs after project, tenant and provider authorization, and routes advertising sharedVoices accept platform voice_shared_... IDs; see voices. Arbitrary upstream custom IDs and stateless voice keys are rejected. Anthropic Messages cannot express audio/video generation faithfully, so it is not advertised for those tasks.
Price cards, provider receipts, margins and billing receipts are independent of presentation style. A translated response's usage summary is not the financial receipt. Read the task's billing fields for final charges; retries reuse the immutable provider snapshot and never submit another paid operation.
Reviewed image references translate between Cloud multipart images/edits, native Google inline parts, and OpenRouter input_references data URLs. Counts, total bytes and actual PNG/JPEG/WebP signatures are checked before admission. OpenAI masks are available only on native OpenAI edits; translated masks are rejected. Provider file IDs and remote reference URLs are not enabled by these defaults.