Gemini 4 Carbon code

Gemini 4 Carbon in your SDK.
Copy, paste, run.

$4.00 in / $20.00 out per 1M · 1.05M context

Carbon speaks the OpenAI request format on Utopixel, so the SDKs and frameworks you already use work after two changes: the base URL and the model id. Streaming, tool calls and JSON output work the normal way.

modelgoogle/gemini-4-carbonGet a key
SDKs

Your stack, Carbon underneath.

Each snippet is the minimum change: base URL and model id.

PythonOpenAI SDK
from openai import OpenAI
client = OpenAI(base_url="https://utopixel.online/api/v1", api_key="sk-vb-...")
r = client.chat.completions.create(
model="google/gemini-4-carbon",
messages=[{"role": "user", "content": "Hello, Gemini 4 Carbon"}],
)
print(r.choices[0].message.content)
print(r.usage) # usage.cost is the charge in USD
Node.jsOpenAI SDK
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://utopixel.online/api/v1", apiKey: process.env.UTOPIXEL_API_KEY });
const r = await client.chat.completions.create({
model: "google/gemini-4-carbon",
messages: [{ role: "user", content: "Hello, Gemini 4 Carbon" }],
});
console.log(r.choices[0].message.content);
PythonLangChain
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="google/gemini-4-carbon", base_url="https://utopixel.online/api/v1", api_key="sk-vb-...")
print(llm.invoke("Explain this stack trace in two lines.").content)
TypeScriptVercel AI SDK
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";
const utopixel = createOpenAICompatible({
name: "utopixel",
apiKey: process.env.UTOPIXEL_API_KEY,
baseURL: "https://utopixel.online/api/v1",
includeUsage: true,
});
const { text } = await generateText({ model: utopixel("google/gemini-4-carbon"), prompt: "Write a haiku about APIs." });
Resilience

Fallback in one parameter.

If Carbon fails or is rate limited, Utopixel tries the next model. You pay only for the answer you get.

PythonFallback to Argon
r = client.chat.completions.create(
model="google/gemini-4-carbon",
messages=[{"role": "user", "content": "Summarize this repo"}],
extra_body={"models": ["google/gemini-4-carbon", "google/gemini-4-argon"]},
)
Q1Do I need Google's genai SDK?
No. On Utopixel you call Carbon with the OpenAI or Anthropic SDK. Google's own SDK format is not supported yet.
Q2Does streaming work?
Yes. Set stream to true and read the server sent events as you would with OpenAI. Each response carries usage.cost with the exact charge in USD.
Q3Can I fall back to another model?
Yes. Send a models list such as ["google/gemini-4-carbon", "google/gemini-4-argon"] and Utopixel calls the next one only if the first fails.

Start building in minutes.

One API key for the models of OpenAI, Google, DeepSeek, Moonshot AI, Qwen, xAI, Z.ai, Meta, Amazon, AionLabs, Anthropic, Baidu, ByteDance Seed, Cohere, Elorian, Fireworks AI, IBM, inclusionAI, Inference.net, KT, Liquid AI, Meituan, Meta, MiniMax, Mistral AI, Moondream, Motif Technologies, Nex AGI, NVIDIA, Particle AI, Perceptron, Prism ML, Reflection AI, Reka, Relace, Ricursive AI, Sakana AI, StepFun, Tencent, Thinking Machines, Unbiased, Upstage, Writer and Xiaomi. Start free, no card needed.