ToAPIs
    homeToAPIs
    模型廣場模型定價API 文檔
    登錄免費開始

    快速结论

    • 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
    體驗區案例相關能力READMEAPI

    设置对话参数

    高级选项

    示例参数

    请求预览

    {
      "model": "gemini-3.1-pro",
      "messages": [
        {
          "role": "system",
          "content": "你是一个严谨、直接、擅长工程拆解的 AI 助手。"
        },
        {
          "role": "user",
          "content": "请用 gemini-3.1-pro 帮我把一个复杂产品需求拆成可执行的工程任务。"
        }
      ],
      "stream": true,
      "max_tokens": 4096,
      "temperature": 0.7
    }
    查看 API 文档
    输入消息开始测试模型。

    生成案例

    探索 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

    这类错误通常说明接口走错了。图像和视频模型一般不走 chat 接口,而是按对应文档发起 HTTP 任务请求,并通过任务状态接口轮询结果。排查时建议先看用户的实际请求代码、请求地址和请求体。

    用户进行生成图片/视频的任务时出现任务失败,但是扣款

    先让用户提供任务日志或截图,重点看是否出现了输入或输出 token 统计。如果有这类 token 记录,大概率是用户把图片/视频模型走成了 chat 接口;这不是正确用法。图片和视频模型通常是异步任务接口,需要通过 HTTP 请求先提交任务,再拿到任务 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.

    Start for freeView API Docs

    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
    ToAPIs
    homeToAPIs

    企業級 AI API 閘道,透過一套介面接入文字、圖片、影片與音訊模型。

    运营主体:
    鯨樞智能科技有限公司
    JINGSHU INTELLIGENT LIMITED
    注册地址:
    ROOM 5042, 5/F, YAU LEE CENTRE, NO.45, HOI YUEN ROAD, KWUN TONG, KOWLOON, HONG KONG
    联系方式:
    support@toapis.com

    模型

    • Sora 2 API
    • Veo 3.1 API
    • GPT Image 2 API
    • 所有模型

    替代方案

    • Fal.ai 替代方案
    • Wavespeed AI 替代方案
    • PiAPI 替代方案
    • CometAPI 替代方案
    • Replicate 替代方案
    • AIMLAPI 替代方案

    資源

    • 文檔
    • 服務狀態
    • 定價
    • 隱私政策
    • 服務條款
    • 使用政策
    • 資料刪除政策
    • 資料保留政策
    • 次處理者與資料區域
    • 計費與退款說明
    • Cookie 政策
    • 網站地圖
    • 關於我們

    © 2026 ToAPIs. 版權所有。