Gemini SDK

Code written for Google’s Gemini API works here as well: set the SDK’s base URL to our address and use your FlintBeam key.

  • Setup in a minute
  • Gemini
  • Google’s own client

Get an API key

Sign up, add money on the Billing page, then create a key. It starts with sk-live- and is shown only once — copy it straight away.

Create API key

Point Gemini SDK at FlintBeam

Set the base URL to our address — the SDK adds /v1beta — and pass your FlintBeam key as the API key.

from google import genai
from google.genai import types

client = genai.Client(
    api_key="sk-live-your-api-key",
    http_options=types.HttpOptions(base_url="https://api.flintbeam.com"),
)
r = client.models.generate_content(model="gemini-3.1-pro", contents="Explain DNS in one paragraph.")
print(r.text)

The key travels as x-goog-api-key. This door needs a key that pays from the balance; a key limited to a plan is refused.

Pick a model

Google’s client takes the model name without google/ in front. Click one and the code above changes with it.

Input / output prices, live from the catalogue. All 140 models →

Check it works

Run the script. Within a few seconds the request shows up in Usage in your dashboard, with the model, tokens and the exact price.

What works where

On this door

  • Text in, text out, streamed or not
  • Gemini models, by their name without google/

Use another door for

  • Pictures, audio, video and PDFs — send those through Chat Completions, Responses or Messages.
  • Other makers’ models — they answer on Chat Completions, Responses and Messages.

If something goes wrong

401Invalid API key

The key is missing, wrong or unknown. Check the header, not the balance.

Check the api_key you pass to the client, and that the key is Active on the API keys page.

402Not enough balance

Not enough balance for the estimated cost of this request.

Top up on the Billing page, or turn on auto top-up so a long session never stops halfway.

404Model not found

No such model on sale. Check the exact code against /v1/models.

Use the Gemini model’s name as the catalogue writes it, here without google/ in front — copy it from the model’s page.

403Key not allowed for this model

This key may not use that model. The model exists — the key is narrowed.

The model exists, but this key was limited to other models. Widen it under “What this key can reach”, or use another key.

429Too many requests

The key's spending limit, request rate or token rate for this period is reached, or the provider is busy for a moment. Wait as long as Retry-After says.

Wait as long as Retry-After says, then try again.

Ready in a minute

Create a key, point your tool at FlintBeam, keep coding.

Create API key

Other integrations

All integrations →