Model
Gemini 3.1 Flash Image API pricing.
- Model idag/gemini-3.1-flash-image
- UpstreamAntigravity
- Endpointschat · messages · responses
Price
What Gemini 3.1 Flash Image costs.
You pay the cheapest live ask from a publisher. An ask is never more than half the official price. Prices update while this page is open.
| Per million tokens | Official | Lowest ask on AIKeys |
|---|---|---|
| Input | $0.30 | $0.15−50% |
| Output | $30.00 | $15.00−50% |
Example: 10M input and 2M output tokens cost $31.50 at the lowest ask, against $63.00 at the official price.
Call it
Send ag/gemini-3.1-flash-image as the model.
One key works with chat completions, messages, and responses. Set AIKEYS_CO_KEY to an inference key. The full reference is on the API page.
curl https://api.aikeys.co/v1/chat/completions \
-H "Authorization: Bearer $AIKEYS_CO_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"ag/gemini-3.1-flash-image","messages":[{"role":"user","content":"Hello"}]}'curl https://api.aikeys.co/v1/chat/completions \
-H "Authorization: Bearer $AIKEYS_CO_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"ag/gemini-3.1-flash-image","messages":[{"role":"user","content":"Hello"}]}'curl https://api.aikeys.co/v1/messages \
-H "x-api-key: $AIKEYS_CO_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model":"ag/gemini-3.1-flash-image","max_tokens":256,"messages":[{"role":"user","content":"Hello"}]}'curl https://api.aikeys.co/v1/messages \
-H "x-api-key: $AIKEYS_CO_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model":"ag/gemini-3.1-flash-image","max_tokens":256,"messages":[{"role":"user","content":"Hello"}]}'import os
from openai import OpenAI
client = OpenAI(base_url="https://api.aikeys.co/v1", api_key=os.environ["AIKEYS_CO_KEY"])
reply = client.chat.completions.create(
model="ag/gemini-3.1-flash-image",
messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)import os
from openai import OpenAI
client = OpenAI(base_url="https://api.aikeys.co/v1", api_key=os.environ["AIKEYS_CO_KEY"])
reply = client.chat.completions.create(
model="ag/gemini-3.1-flash-image",
messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)import os
from anthropic import Anthropic
client = Anthropic(base_url="https://api.aikeys.co", api_key=os.environ["AIKEYS_CO_KEY"])
message = client.messages.create(
model="ag/gemini-3.1-flash-image",
max_tokens=256,
messages=[{"role": "user", "content": "Hello"}],
)
print(message.content[0].text)import os
from anthropic import Anthropic
client = Anthropic(base_url="https://api.aikeys.co", api_key=os.environ["AIKEYS_CO_KEY"])
message = client.messages.create(
model="ag/gemini-3.1-flash-image",
max_tokens=256,
messages=[{"role": "user", "content": "Hello"}],
)
print(message.content[0].text)FAQ
Questions about Gemini 3.1 Flash Image.
- How much does Gemini 3.1 Flash Image cost on AIKeys?
- The official price is $0.30 per million input tokens and $30.00 per million output tokens. On AIKeys you pay the cheapest live ask from a publisher, and an ask is never more than half the official price. The table on this page shows the current lowest ask.
- What model id do I send for Gemini 3.1 Flash Image?
- Send ag/gemini-3.1-flash-image as the model. The id must match exactly. GET https://api.aikeys.co/v1/models lists every id your key can call.
- Can I call Gemini 3.1 Flash Image with the OpenAI or the Anthropic SDK?
- Yes. The same key works on chat completions, messages, and responses. Point the OpenAI SDK at https://api.aikeys.co/v1, or the Anthropic SDK at https://api.aikeys.co. The proxy converts the request to the format the upstream uses.
- What happens if no publisher is serving Gemini 3.1 Flash Image?
- The call returns 503 with the code no_capacity. You are not charged for it.
- Is there a monthly plan?
- No. You top up a balance and each settled request draws from it. Stop calling and the charges stop.
Antigravity
Other models on this upstream.
- Claude Opus 4.6 (Thinking)ag/claude-opus-4-6-thinking$2.50 / $12.50
- Claude Sonnet 4.6 (Thinking)ag/claude-sonnet-4-6$1.50 / $7.50
- GPT-OSS 120B (Medium)ag/gpt-oss-120b-medium$0.075 / $0.30
- Gemini 2.5 Proag/gemini-2.5-pro$0.625 / $5.00
- Gemini 3 Flashag/gemini-3-flash$0.15 / $1.25
- Gemini 3.1 Flash Liteag/gemini-3.1-flash-lite$0.05 / $0.20