Google Gemini Gemini Models API

The Gemini Models API from Google Gemini — 20 operation(s) for gemini models.

GitHub OpenAPI

Operations 20

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /v1beta/models/{modelsId}:generateText Generate text from a prompt · Generate text models #
Ask an LLM
“How do I get a model to write a story or answer a question from a prompt?”
“Can I cap the number of tokens in a text generation?”
Tell an agent
Generate text from prompt {prompt} on model {modelsId}.
Write {candidateCount} text responses from {prompt} on {modelsId}, each capped at {maxOutputTokens} tokens.
GET /v1beta/models List available text generation models · List models #
Ask an LLM
“Which Gemini models can I use for text generation?”
“What are the token limits of each model?”
Tell an agent
List all available text generation models.
Show the first {pageSize} models available for text generation.
POST /v1beta/models/{modelsId}:countTextTokens Count tokens in text · Count text tokens models #
Ask an LLM
“How many tokens does a given piece of text take up in a model?”
“Can I check token count before sending a long prompt?”
Tell an agent
Count the tokens in {prompt} using model {modelsId}.
Tell me how many tokens {prompt} would use on {modelsId}.
POST /v1beta/models/{modelsId}:streamGenerateContent Stream a model response · Stream generate content models #
Ask an LLM
“Can I stream a model's answer piece by piece as it writes?”
“Is there a streaming version of text generation for long responses?”
Tell an agent
Stream a generation from {contents} on model {modelsId}.
Stream a model response to {contents} on {modelsId} with safety settings {safetySettings}.
POST /v1beta/models/{modelsId}:batchEmbedText Batch embed a list of texts · Batch embed text models #
Ask an LLM
“Can I turn a batch of short texts into embedding vectors at once?”
“What is the maximum number of texts I can embed in one batch?”
Tell an agent
Batch embed these texts: {texts} using model {modelsId}.
Embed {texts} in one request on {modelsId}.
GET /v1beta/models/{modelsId} Get a model's details · Get models #
Ask an LLM
“What parameters and token limits does a specific model have?”
“How do I look up one model's metadata by its name?”
Tell an agent
Get the details of model {modelsId}.
Show the version number and token limits for {modelsId}.
POST /v1beta/models/{modelsId}:embedText Embed a single text string · Embed text models #
Ask an LLM
“How do I turn one sentence into an embedding vector?”
“Can I embed a single text string without a chat history?”
Tell an agent
Embed the text {text} using model {modelsId}.
Create an embedding vector for {text} on {modelsId}.
POST /v1beta/models/{modelsId}:embedContent Embed structured content · Embed content models #
Ask an LLM
“Can I embed a chat message or document title as structured content?”
“What embedding options exist for a single piece of content?”
Tell an agent
Embed content {content} using model {modelsId}.
Embed {content} on {modelsId} as a {taskType} task.
POST /v1beta/models/{modelsId}:predictLongRunning Run a long-running prediction (deprecated) · Predict long running models #
Ask an LLM
“Is there a long-running prediction call that returns an operation ID?”
“Can I track a prediction that takes a while to finish?”
Tell an agent
Run a long-running prediction on {instances} for model {modelsId}.
Submit {instances} for a long-running prediction on {modelsId} with labels {labels}.
POST /v1beta/models/{modelsId}:generateMessage Generate a chat-style message · Generate message models #
Ask an LLM
“How do I get a model to reply to a chat prompt as a message?”
“Can I set the temperature on a chat message generation?”
Tell an agent
Generate a chat message from {prompt} on model {modelsId}.
Reply to {prompt} on {modelsId} with temperature {temperature} and {candidateCount} candidates.
POST /v1beta/models/{modelsId}:countTokens Count the tokens in text · Count tokens models #
Ask an LLM
“How many tokens does a prompt take up in Gemini?”
“Can I estimate token count before sending a generation request?”
Tell an agent
Count tokens in {contents} on model {modelsId}.
Estimate tokens for prompt {contents} using model {modelsId}.
POST /v1beta/models/{modelsId}:generateAnswer Answer a question from passages · Generate answer models #
Ask an LLM
“Can I get a model to answer a question grounded in a set of passages?”
“What answer styles can I choose from when answering a question?”
Tell an agent
Answer {contents} using passages {inlinePassages} on model {modelsId}.
Answer {contents} on {modelsId} in {answerStyle} style.
POST /v1beta/models/{modelsId}:generateContent Generate a model response to content · Generate content models #
Ask an LLM
“How do I get a model to respond to a chat history or document?”
“Can I use tools when generating a model response?”
Tell an agent
Generate a response to {contents} on model {modelsId}.
Respond to {contents} on {modelsId} with tools {tools} and safety settings {safetySettings}.
POST /v1beta/models/{modelsId}:asyncBatchEmbedContent Enqueue a batch of embedding requests · Async batch embed content models #
Ask an LLM
“Can I queue many embedding requests to be processed in the background?”
“Is there an asynchronous batch embed for content?”
Tell an agent
Enqueue batch {batch} for embedding on model {modelsId}.
Queue these embedding requests {batch} on {modelsId}.
POST /v1beta/models/{modelsId}:countMessageTokens Count tokens in a chat message · Count message tokens models #
Ask an LLM
“How many tokens does a single chat message use?”
“Can I count tokens for a message string before sending it?”
Tell an agent
Count the tokens in message {prompt} on model {modelsId}.
Tell me how many tokens {prompt} takes on {modelsId}.
POST /v1beta/models/{modelsId}:batchEmbedContents Batch embed a list of content objects · Batch embed contents models #
Ask an LLM
“Can I embed many pieces of content in one request?”
“What does each request in a batch of content embeddings need?”
Tell an agent
Batch embed these content requests {requests} on model {modelsId}.
Embed each of {requests} on {modelsId}.
POST /v1beta/models/{modelsId}:predict Run a prediction on a model (deprecated) · Predict models #
Ask an LLM
“Is there an older prediction call that takes instances and parameters?”
“Can I still use the legacy prediction method for a model?”
Tell an agent
Run a legacy prediction on {instances} for model {modelsId}.
Predict on {instances} for {modelsId} with parameters {parameters}.
POST /v1beta/models/{modelsId}:batchGenerateContent Enqueue a batch of generation requests · Batch generate content models #
Ask an LLM
“Can I queue many generation requests to be processed in the background?”
“Is there an asynchronous batch generate for content?”
Tell an agent
Enqueue batch {batch} for generation on model {modelsId}.
Queue these generation requests {batch} on {modelsId}.
GET /v1beta/models/{modelsId}/operations/{operationsId} Get a long-running operation · Get operations #
Ask an LLM
“How do I check the result of a long-running operation?”
“What state is a queued operation in?”
Tell an agent
Get operation {operationsId} on model {modelsId}.
Check the status of long-running operation {operationsId} for {modelsId}.
GET /v1beta/models/{modelsId}/operations List long-running operations · List operations #
Ask an LLM
“Which long-running operations are still running on a model?”
“Can I filter the operations on a model?”
Tell an agent
List the long-running operations on model {modelsId}.
Show operations on {modelsId} matching {filter}.

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/google-gemini:google-gemini-models-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

google-gemini-models-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Gemini Models API
  version: v1beta
  description: Generated from Google's published Discovery document for Gemini API (generativelanguage v1beta, revision 20261111). 20 operation(s).
  contact:
    name: Google
    url: https://developers.google.com/
  termsOfService: https://developers.google.com/terms
servers:
- url: https://generativelanguage.googleapis.com
tags:


# --- truncated at 32 KB (175 KB total) ---
# Full source: https://artifacts.apis.io/google-gemini/openapi/google-gemini-models-api-openapi.yml