LLM API

gemma4-12b-direct

Gemma 4 12B with an adapter that declines fewer requests.

InputText & images · 16 inline images maximum
PricingContact us for pricing

Try it in the console playground — you sign in first, and it uses your organization’s quota.

Quickstart

Set TOKENFLOW_API_KEY privately in your shell. This page never asks for your key or runs a request.

Chat Completions

POST /v1/chat/completions · application/json

curl · JSON response
curl --fail-with-body 'https://api.tokenflow.dev/v1/chat/completions' \
  -H "Authorization: Bearer $TOKENFLOW_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "gemma4-12b-direct",
  "messages": [
    {
      "role": "user",
      "content": "Say hello."
    }
  ],
  "max_tokens": 32
}'

  • Images must be inline data URLs or base64; remote image URLs are refused.

Responses

POST /v1/responses · application/json

curl · JSON response
curl --fail-with-body 'https://api.tokenflow.dev/v1/responses' \
  -H "Authorization: Bearer $TOKENFLOW_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "gemma4-12b-direct",
  "input": "Say hello.",
  "max_output_tokens": 32
}'

  • Images must be inline data URLs or base64; remote image URLs are refused.

Anthropic Messages

POST /v1/messages · application/json

curl · JSON response
curl --fail-with-body 'https://api.tokenflow.dev/v1/messages' \
  -H "Authorization: Bearer $TOKENFLOW_API_KEY" \
  -H 'anthropic-version: 2023-06-01' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "gemma4-12b-direct",
  "messages": [
    {
      "role": "user",
      "content": "Say hello."
    }
  ],
  "max_tokens": 32
}'

  • Images must be inline data URLs or base64; remote image URLs are refused.

Legacy Completions

POST /v1/completions · application/json

curl · JSON response
curl --fail-with-body 'https://api.tokenflow.dev/v1/completions' \
  -H "Authorization: Bearer $TOKENFLOW_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "gemma4-12b-direct",
  "prompt": "Say hello.",
  "max_tokens": 32
}'

  • Images must be inline data URLs or base64; remote image URLs are refused.

Parameters & limits

Images
Up to 16 inline images; no remote image URLs
Documented context
128K tokens (prompt + output). A specification, not a live engine capacity check.
Features
Tool calls · Streaming · Prompt caching · JSON mode and structured output

Up to 16 images per request, inline only (data URL or base64).

You are responsible for what you ask it to write.

Pricing & usage

Contact us for pricing

Quota usage counts uncached input and output tokens. An unpublished price does not mean free usage.

Quota errors and retry guidance →

View the machine-readable contract

Published specification only. Inspect the discovery API for runtime observations; discovery does not reserve capacity.

{
  "id": "gemma4-12b-direct",
  "kind": "llm",
  "summary": "Gemma 4 12B with an adapter that declines fewer requests.",
  "tags": [
    "chat",
    "coding",
    "聊天",
    "文本"
  ],
  "protocols": [
    {
      "id": "chat",
      "method": "POST",
      "path": "/v1/chat/completions",
      "content_type": "application/json",
      "modes": [
        "json",
        "sse"
      ],
      "schema_scope": "supported_subset",
      "input_schema": {
        "type": "object",
        "properties": {
          "model": {
            "const": "gemma4-12b-direct"
          },
          "messages": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object"
            }
          },
          "stream": {
            "type": "boolean"
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "model",
          "messages"
        ],
        "additionalProperties": true
      },
      "constraints": [
        "Follow the selected protocol. This schema documents a subset, not all engine parameters.",
        "Images must be inline data URLs or base64; remote image URLs are refused."
      ],
      "example": {
        "model": "gemma4-12b-direct",
        "messages": [
          {
            "role": "user",
            "content": "Say hello."
          }
        ],
        "max_tokens": 32
      }
    },
    {
      "id": "completions",
      "method": "POST",
      "path": "/v1/completions",
      "content_type": "application/json",
      "modes": [
        "json",
        "sse"
      ],
      "schema_scope": "supported_subset",
      "input_schema": {
        "type": "object",
        "properties": {
          "model": {
            "const": "gemma4-12b-direct"
          },
          "prompt": {
            "type": [
              "string",
              "array"
            ]
          },
          "stream": {
            "type": "boolean"
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "model",
          "prompt"
        ],
        "additionalProperties": true
      },
      "constraints": [
        "Follow the selected protocol. This schema documents a subset, not all engine parameters.",
        "Images must be inline data URLs or base64; remote image URLs are refused."
      ],
      "example": {
        "model": "gemma4-12b-direct",
        "prompt": "Say hello.",
        "max_tokens": 32
      }
    },
    {
      "id": "responses",
      "method": "POST",
      "path": "/v1/responses",
      "content_type": "application/json",
      "modes": [
        "json",
        "sse"
      ],
      "schema_scope": "supported_subset",
      "input_schema": {
        "type": "object",
        "properties": {
          "model": {
            "const": "gemma4-12b-direct"
          },
          "input": {
            "type": [
              "string",
              "array"
            ]
          },
          "stream": {
            "type": "boolean"
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "model",
          "input"
        ],
        "additionalProperties": true
      },
      "constraints": [
        "Follow the selected protocol. This schema documents a subset, not all engine parameters.",
        "Images must be inline data URLs or base64; remote image URLs are refused."
      ],
      "example": {
        "model": "gemma4-12b-direct",
        "input": "Say hello.",
        "max_output_tokens": 32
      }
    },
    {
      "id": "messages",
      "method": "POST",
      "path": "/v1/messages",
      "content_type": "application/json",
      "modes": [
        "json",
        "sse"
      ],
      "schema_scope": "supported_subset",
      "input_schema": {
        "type": "object",
        "properties": {
          "model": {
            "const": "gemma4-12b-direct"
          },
          "messages": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object"
            }
          },
          "stream": {
            "type": "boolean"
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "model",
          "messages",
          "max_tokens"
        ],
        "additionalProperties": true
      },
      "constraints": [
        "Follow the selected protocol. This schema documents a subset, not all engine parameters.",
        "Images must be inline data URLs or base64; remote image URLs are refused."
      ],
      "example": {
        "model": "gemma4-12b-direct",
        "messages": [
          {
            "role": "user",
            "content": "Say hello."
          }
        ],
        "max_tokens": 32
      }
    }
  ],
  "guaranteed": {
    "max_images": 16,
    "remote_images": false
  },
  "documented": {
    "context_tokens": 131072,
    "context_runtime_verified": false,
    "features": [
      "Tool calls",
      "Streaming",
      "Prompt caching",
      "JSON mode and structured output"
    ],
    "limitations": [
      "Up to 16 images per request, inline only (data URL or base64).",
      "You are responsible for what you ask it to write."
    ]
  },
  "billing": {
    "meter": "tokens",
    "quota_basis": "uncached_input_plus_output",
    "pricing": {
      "status": "quote_required"
    }
  },
  "external_limits": null,
  "schema_version": 1,
  "publication": "public",
  "next": [
    {
      "method": "POST",
      "path": "/v1/chat/completions",
      "content_type": "application/json",
      "body": {
        "model": "gemma4-12b-direct",
        "messages": [
          {
            "role": "user",
            "content": "Say hello."
          }
        ],
        "max_tokens": 32
      }
    },
    {
      "method": "POST",
      "path": "/v1/completions",
      "content_type": "application/json",
      "body": {
        "model": "gemma4-12b-direct",
        "prompt": "Say hello.",
        "max_tokens": 32
      }
    },
    {
      "method": "POST",
      "path": "/v1/responses",
      "content_type": "application/json",
      "body": {
        "model": "gemma4-12b-direct",
        "input": "Say hello.",
        "max_output_tokens": 32
      }
    },
    {
      "method": "POST",
      "path": "/v1/messages",
      "content_type": "application/json",
      "body": {
        "model": "gemma4-12b-direct",
        "messages": [
          {
            "role": "user",
            "content": "Say hello."
          }
        ],
        "max_tokens": 32
      }
    }
  ]
}

For developers and agents

Choose your way in

Human guides and machine-readable contracts describe the same APIs.

Need runtime observations? Use the public discovery API. Tenant access and quotas require your API key.

Published contract updated 2 November 2026. Terms · Data policy · All capabilities