Gemma 2 (27b) API

Gemma-2 27B is a powerful language model designed for efficient text generation across multiple applications with significant performance enhancements.

Modalities
TextText
In / Out price
$0.6877/$0.6877per 1M
Context window
8K tokens
Released
Jul 13, 2024

Gemma 2 (27b) overview

The pelican test: one prompt, every text model, unedited SVG output from Nov 3, 2026.

SVG of a pelican riding a bicycle, written by Gemma 2 (27b) through AI/ML API

Gemma 2 (27b) by Google

Discover Gemma-2 27B by Google, a high-performance language model optimized for diverse text generation tasks with broad language support.

Gemma 2 (27b) specs

Model ID
google/gemma-2-27b-it
Developer
Google
Context window
8,192 tokens
Max output
2,048 tokens
Input
Text
Output
Text
API
OpenAI-compatible, base URL https://api.aimlapi.com/v1

Basic Information

  • Model Type: Large Language Model (LLM)

Overview:

Gemma-2 27B is a high-performance language model designed to handle a diverse range of text generation tasks, including question answering, summarization, and reasoning. It offers significant improvements in efficiency and performance compared to its predecessors, making it suitable for various applications in natural language processing.

Key Features:

  • 27 billion parameters, providing robust performance for complex tasks.
  • Large context window of up to 8,192 tokens, allowing for extensive input handling.
  • Fine-tuned for improved accuracy in generating coherent and contextually relevant responses.
  • Supports multiple languages, enhancing its usability in global applications.
  • Designed for efficient inference on NVIDIA GPUs and TPUs, reducing operational costs.

Intended Use:

The model is intended for software developers and researchers looking to implement advanced language processing capabilities in applications such as chatbots, content creation tools, and automated customer support systems.

Language Support:

Gemma-2 27B supports multiple languages, primarily focusing on English while also accommodating other widely spoken languages.

Architecture:

Gemma-2 27B employs a transformer architecture optimized for both performance and efficiency. It utilizes techniques such as grouped-query attention to enhance inference speed while maintaining high-quality outputs.

Use cases

  • High‑Quality Chatbots: Comparable to much larger closed models in dialogue fluency
  • Conversational Agents: Ideal for customer support, virtual assistants
  • Reasoning & QA: Strong performance across MMLU, GSM8K, ARC, HellaSwag benchmarks  
  • Efficient Plotting: Code-like suggestions and logic reasoning
  • Edge Deployment: Runs efficiently on single A100/H100 GPU or TPU  

Capabilities

  • Function calling
  • Streaming
  • Structured outputs

Gemma 2 (27b) API pricing

Gemma 2 (27b) pricing in US dollars
UsagePriceUnit
Input$0.68771M tokens
Output$0.68771M tokens

Prices from the AI/ML API price list, checked on Nov 4, 2026.

Gemma 2 (27b) vs other models: token prices

AI/ML API input and output rates for 5 models, per million tokens.

AI/ML API model prices in USD per million tokens
ModelInputOutput
Gemma 2 (27b)$0.6877$0.6877
Gemini 3.5 Flash Lite$0.3$2.5
Gemini 3.8 Flash$0.75$3.75
Gemini 3.7 Flash$0.75$3.75
Gemini 4 Argon$2$10

How to use the Gemma 2 (27b) API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "google/gemma-2-27b-it",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'

Related articles

All posts

Gemma 2 (27b) FAQ

What is the context window of Gemma 2 (27b)?

Gemma 2 (27b) has a 8,192 tokens context window and can return up to 2,048 tokens.

What inputs and outputs does Gemma 2 (27b) support?

Gemma 2 (27b) takes image, text as input and returns text.

What is the model ID for Gemma 2 (27b)?

Use google/gemma-2-27b-it as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

How much does Gemma 2 (27b) cost?

Gemma 2 (27b) costs $0.6877 input and $0.6877 output per 1M tokens on AI/ML API, billed as you go with no subscription.

Does Gemma 2 (27b) support streaming?

Yes, Gemma 2 (27b) can stream responses as they are generated.

Can Gemma 2 (27b) read images?

Yes, Gemma 2 (27b) accepts image input alongside text.

Who created Gemma 2 (27b)?

Gemma 2 (27b) was built by Google.

Start building with Gemma 2 (27b)

Gemma 2 (27b) API

google/gemma-2-27b-it

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "google/gemma-2-27b-it",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'