Краткий вывод

  • Supports prompt-based text-to-image workflows for marketing and creative assets.
  • Supports reference-guided generation for stronger style consistency.
  • Stabilize parameters in this guide first, then move into production API.

Ключевые параметры

  • model | string | обяз. | gemini-3.1-pro | - | Exact model identifier from ToAPIs.
  • prompt | string | обяз. | - | - | Primary image instruction prompt.
  • size | string | опц. | 1:1 | - | Output aspect ratio, model-dependent.
  • n | integer | опц. | 1 | - | Number of generated images per request.
  • reference_images | file[] | опц. | - | - | Reference images for style consistency.

Частые ошибки

  • 400 invalid_request_error: триггер=Missing or invalid payload fields.; исправление=Validate model/prompt/size payload fields.; повтор=Retry only after payload fix.
  • 401 authentication_error: триггер=Missing or invalid API key.; исправление=Verify Authorization header and key scope.; повтор=Retry after authentication fix.

gemini-3.1-pro

gemini-3.1-pro by Google (Gemini) is optimized for image generation/editing workflows. Contracts follow ToAPIs docs for production-ready API integration.

Тип модели:
Цена: Input 80 кредитов/1M, Output 480 кредитов/1M
Type a message to test the model.

Примеры генерации

Примеры генерации gemini-3.1-pro

Создать с этой моделью
gemini-3.1-pro guide example 1

gemini-3.1-pro #1

gemini-3.1-pro guide example 2

gemini-3.1-pro #2

gemini-3.1-pro guide example 3

gemini-3.1-pro #3

Прозрачные цены

gemini-3.1-pro pricing

Text usage is billed by actual token consumption. Final billing follows the current account quote.

Пополнить кредиты
Input 80 кредитов/1M, Output 480 кредитов/1M

Почему ToAPIs

Why call gemini-3.1-pro through ToAPIs?

Keep model access, API keys, billing, and usage management in one workflow.

High-quality generation

Generate production-ready visual assets via a unified API.

Reference consistency

Use references to stabilize style and composition.

Parameter tuning

Tune ratio/count/sampling for quality and cost balance.

Connect in three steps

Create a key, send a compatible chat request, and monitor usage.

  1. 1

    Step 1

    Set Authorization: Bearer <YOUR_API_KEY>.

  2. 2

    Step 2

    Call image generation endpoint with model, prompt, and size.

  3. 3

    Step 3

    Optionally pass reference_images for stronger consistency.

When to use gemini-3.1-pro

Use case 1

When generating marketing, e-commerce, and social visual assets quickly.

Use case 2

When reference-guided consistency is required.

Частые вопросы

gemini-3.1-pro FAQ

What is gemini-3.1-pro best for?

Best for high-frequency creative generation and reference-guided consistency workflows.

Ошибка у модели изображений или видео: invalid apitype: -1

Обычно это означает, что запрос отправлен не в тот endpoint. Модели изображений и видео обычно не используют chat endpoint. Вместо этого нужно отправлять HTTP-запрос на создание задачи по документации и затем опрашивать endpoint статуса задачи. Сначала проверьте фактический код запроса, URL и payload.

Задача на генерацию изображения или видео завершилась ошибкой, но списание произошло

Сначала попросите у пользователя лог задачи или скриншот и проверьте, есть ли там статистика входных или выходных токенов. Если учет токенов есть, запрос, скорее всего, был отправлен через chat endpoint, а не через правильный media workflow. Модели изображений и видео обычно работают как асинхронные HTTP task API: сначала отправляется задача, затем выполняется опрос по task id согласно документации.

gemini-3.1-pro API

Start building with gemini-3.1-pro

Test a request here, then continue in the dashboard or API documentation.

Try gemini-3.1-pro with one ToAPIs key.

Use the same account and API surface across supported text models.

Sign up to get free credits