Docs
  1. Official Endpoint - v1beta
Docs
  • Introduction
  • Quick Start Guide
  • Make a request
  • YEScale System API Tutorial
  • Chat Models
    • ChatGpt
      • ChatGPT (Audio)
        • Create transcription by gpt-4o-mini-transcribe & gpt-4o-transcribe
        • Create a voice with gpt-4o-mini-tts
        • Create a voice
        • Create a transcript
        • Create translation
      • ChatGPT (Chat)
        • Chat completion object
        • Create chat completion (streaming)
        • Create chat completion (non-streaming)
        • Create chat image recognition (streaming)
        • Create chat image recognition (streaming) base64
        • Create chat image recognition (non-streaming)
        • Function calling
        • N choices
        • Create chat function call (only non-streaming)
        • Create structured output
      • ChatGPT (Completions)
        • Completion object
        • Creation completed
      • ChatGPT(Embeddings)
        • Embedded Object
        • Create embed
    • Anthropic Claude
      • Offical Format
        • Messages (official Anthropic format)
        • Messages(Image Recognition)
        • Messages(function call)
        • Messages(Web search)
      • Create chat completion (streaming)
      • Create chat completion (non-streaming)
      • Create chat image recognition (streaming)
      • Create chat image recognition (non-streaming)
    • Gemini
      • Official Endpoint - v1beta
        • Text generation
          POST
        • Thinking with Gemini 2.5
          POST
        • Structured output
          POST
        • Function calling
          POST
        • Grounding with Google Search
          POST
        • URL context
          POST
        • Gemini TTS
          POST
      • OpenAI Endpoint Chat
        • Gemini Image creation interface (gemini-2.0-flash-exp-image-generation)
        • Chat interface
        • Image recognition interface
        • Function calling - Google Search
        • Function calling - codeExecution
    • Deepseek
      • Deepseek v3.1
  • Image Models
    • GPT-IMAGE-1
      • Generate Image by gpt-image-1
      • Edit Image by gpt-image-1
    • QWEN IMAGE
      • Generate Image by qwen-image
      • Edit Image by qwen-image-edit
    • MJ
      • Submit Imagine task (mj_imagine)
      • Submit Blend task (mj_blend)
      • Submit Describe task (mj_describe)
      • Submit Change task (mj_variation, mj_upscale,mj_reroll)
      • Query task status based on task ID
    • Ideogram
      • Generate with Ideogram 3.0
      • Edit with Ideogram 3.0
      • Remix with Ideogram 3.0
      • Ideogram Upscale
    • Kling Image
      • Submit Image Generation
      • Get Image by Task ID
      • Submit Kolors Virtual Try On
      • Get Kolors Virtual Try On by Task ID
    • Flux
      • Flux on Replicate
        • Submit Image by flux-kontext-pro
        • Submit Image by flux-kontext-max
        • Submit Image by flux-pro
        • Submit Image by flux-pro-1.1-ultra
        • Get Image by ID
    • Recraft API
      • Recraft Image
      • Generate Image
      • Generate Vector Image
      • Remove Background
      • Clarity Upscale
      • Generative Upscale
    • Models use Dall-e Format
      • Google Imagen
      • Bytedance - seedream-3.0
      • Recraftv3 use Dall-e endpoint
      • Flux use Dall-e endpoint
      • Bytedance - Seedream-4.0
    • Google Imagen
      • Google/imagen-4 on Replicate
      • Get Imagen 4 Task
    • Gemini-2.5-flash-image
      • Official Endpoint
        • Image generation with Gemini (aka Nano Banana)
        • Image editing (text-and-image-to-image)
      • OpenAI Chat
        • Create Text to Image
        • Edit Image - Base64 Image -> Image
      • Create Text to Image (Dall-e endpoint)
      • Edit Image (Gpt-image-1 Endpoint)
    • DALL·E 3
      POST
  • Video Models
    • Kling Video
      • Create Video by Text
      • Get Video by Task ID(text2video)
      • Create Video by Image
      • Get Video by Task ID(image2video)
    • Runway ML Video
      • Create Video by Runway
      • Get Video by Task ID
    • Luma Video
      • Create Video by Luma
      • Get Video by Task ID
    • Pika Video
      • Create Video by Pika
      • Get Video by Task ID
    • Google Veo
      • Submit Video Request
      • Submit Video Request with Frames
      • Get Video by ID
    • Minimax - Hailuo
      • Submit Video Request
      • Get Video
    • Seedance
      • Submit Video Request
      • Get Video by Task ID
    • Mj Video
      • Submit Mj Video Request
      • Get Mj Video by task id
  • FAL-AI Models
    • Images Models
      • Ideogram/v3/remix
      • Flux-pro/kontext/max
      • Fal-bytedance-seededit-v3-edit-image
      • Fal-recraft-v3-text-to-image
      • Fal-recraft-v3-image-to-image
      • Fal-recraft-upscale-crisp
    • Audio Models
      • Minimax/speech-02-hd
      • Minimax/speech-02-turbo
      • Elevenlabs/tts/turbo-v2.5
      • Elevenlabs/tts/multilingual-v2
      • Elevenlabs/tts/eleven-v3
    • Video Models
      • Topaz/upscale/video
      • Luma-dream-machine/ray-2-flash/reframe
      • Luma-dream-machine/ray-2/reframe
      • Kling/Lipsync- Audio2Video
      • Kling/Lipsync- Text2Video
    • Get FAL-AI tasks
  • Music Model - Suno
    • Illustrate
    • Parameter
    • Task submission
      • Generate songs (inspiration, customization, continuation)
      • Generate lyrics
    • Query interface
      • Query a single task
  • Python Samples
    • python openai official library (using AutoGPT, langchain, etc.)
    • Python uses speech to text
    • Python uses text to speech
    • Python uses Embeddings
    • python calls DALL·E
    • python simple call openai function-calling demo
    • python langchain
    • python llama_index
    • Python uses gpt-4o to identify pictures-local pictures
    • python library streaming output
    • Python uses gpt-4o to identify images
  • Plug-in/software usage tutorials
    • Setting HTTP for Make.com with Yescale
    • Sample Code for gpt-4o-audio/gpt-4o-mini-audio
  • Help Center
    • HTTP status codes
  • Tutorials
    • GPT-Image-1 API: A Step-by-Step Guide With Examples
    • Claude Code via YEScale API
    • Task Sync Endpoint Usage Guide
  1. Official Endpoint - v1beta

URL context

POST
/v1beta/models/{model_name}:generateContent

Request

Path Params

Header Params

Body Params application/json

Example
{
  "contents": [
    {
      "parts": [
        {
          "text": "Compare the ingredients and cooking times from the recipes at https://www.foodnetwork.com/recipes/ina-garten/perfect-roast-chicken-recipe-1940592 and https://www.allrecipes.com/recipe/21151/simple-whole-roast-chicken/"
        }
      ]
    }
  ],
  "tools": [
    {
      "url_context": {}
    }
  ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/v1beta/models/:generateContent' \
--header 'x-goog-api-key;' \
--header 'Content-Type: application/json' \
--data-raw '{
  "contents": [
    {
      "parts": [
        {
          "text": "Compare the ingredients and cooking times from the recipes at https://www.foodnetwork.com/recipes/ina-garten/perfect-roast-chicken-recipe-1940592 and https://www.allrecipes.com/recipe/21151/simple-whole-roast-chicken/"
        }
      ]
    }
  ],
  "tools": [
    {
      "url_context": {}
    }
  ]
}'

Responses

🟢200OK
application/json
Body

Example
{
    "candidates": [
        {
            "content": {
                "parts": [
                    {
                        "text": "Spain won the UEFA Euro 2024 tournament, defeating England 2-1 in the final held in Berlin. This victory marked Spain's record-breaking fourth UEFA European Championship title. Nico Williams and Mikel Oyarzabal scored the goals for Spain in the final. Spain won all seven of their matches throughout the tournament."
                    }
                ],
                "role": "model"
            },
            "finishReason": "STOP",
            "index": 0,
            "groundingMetadata": {
                "searchEntryPoint": {
                    "renderedContent": "<style>\n.container {\n  align-items: center;\n  border-radius: 8px;\n  display: flex;\n  font-family: Google Sans, Roboto, sans-serif;\n  font-size: 14px;\n  line-height: 20px;\n  padding: 8px 12px;\n}\n.chip {\n  display: inline-block;\n  border: solid 1px;\n  border-radius: 16px;\n  min-width: 14px;\n  padding: 5px 16px;\n  text-align: center;\n  user-select: none;\n  margin: 0 8px;\n  -webkit-tap-highlight-color: transparent;\n}\n.carousel {\n  overflow: auto;\n  scrollbar-width: none;\n  white-space: nowrap;\n  margin-right: -12px;\n}\n.headline {\n  display: flex;\n  margin-right: 4px;\n}\n.gradient-container {\n  position: relative;\n}\n.gradient {\n  position: absolute;\n  transform: translate(3px, -9px);\n  height: 36px;\n  width: 9px;\n}\n@media (prefers-color-scheme: light) {\n  .container {\n    background-color: #fafafa;\n    box-shadow: 0 0 0 1px #0000000f;\n  }\n  .headline-label {\n    color: #1f1f1f;\n  }\n  .chip {\n    background-color: #ffffff;\n    border-color: #d2d2d2;\n    color: #5e5e5e;\n    text-decoration: none;\n  }\n  .chip:hover {\n    background-color: #f2f2f2;\n  }\n  .chip:focus {\n    background-color: #f2f2f2;\n  }\n  .chip:active {\n    background-color: #d8d8d8;\n    border-color: #b6b6b6;\n  }\n  .logo-dark {\n    display: none;\n  }\n  .gradient {\n    background: linear-gradient(90deg, #fafafa 15%, #fafafa00 100%);\n  }\n}\n@media (prefers-color-scheme: dark) {\n  .container {\n    background-color: #1f1f1f;\n    box-shadow: 0 0 0 1px #ffffff26;\n  }\n  .headline-label {\n    color: #fff;\n  }\n  .chip {\n    background-color: #2c2c2c;\n    border-color: #3c4043;\n    color: #fff;\n    text-decoration: none;\n  }\n  .chip:hover {\n    background-color: #353536;\n  }\n  .chip:focus {\n    background-color: #353536;\n  }\n  .chip:active {\n    background-color: #464849;\n    border-color: #53575b;\n  }\n  .logo-light {\n    display: none;\n  }\n  .gradient {\n    background: linear-gradient(90deg, #1f1f1f 15%, #1f1f1f00 100%);\n  }\n}\n</style>\n<div class=\"container\">\n  <div class=\"headline\">\n    <svg class=\"logo-light\" width=\"18\" height=\"18\" viewBox=\"9 9 35 35\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n      <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M42.8622 27.0064C42.8622 25.7839 42.7525 24.6084 42.5487 23.4799H26.3109V30.1568H35.5897C35.1821 32.3041 33.9596 34.1222 32.1258 35.3448V39.6864H37.7213C40.9814 36.677 42.8622 32.2571 42.8622 27.0064V27.0064Z\" fill=\"#4285F4\"/>\n      <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M26.3109 43.8555C30.9659 43.8555 34.8687 42.3195 37.7213 39.6863L32.1258 35.3447C30.5898 36.3792 28.6306 37.0061 26.3109 37.0061C21.8282 37.0061 18.0195 33.9811 16.6559 29.906H10.9194V34.3573C13.7563 39.9841 19.5712 43.8555 26.3109 43.8555V43.8555Z\" fill=\"#34A853\"/>\n      <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16.6559 29.8904C16.3111 28.8559 16.1074 27.7588 16.1074 26.6146C16.1074 25.4704 16.3111 24.3733 16.6559 23.3388V18.8875H10.9194C9.74388 21.2072 9.06992 23.8247 9.06992 26.6146C9.06992 29.4045 9.74388 32.022 10.9194 34.3417L15.3864 30.8621L16.6559 29.8904V29.8904Z\" fill=\"#FBBC05\"/>\n      <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M26.3109 16.2386C28.85 16.2386 31.107 17.1164 32.9095 18.8091L37.8466 13.8719C34.853 11.082 30.9659 9.3736 26.3109 9.3736C19.5712 9.3736 13.7563 13.245 10.9194 18.8875L16.6559 23.3388C18.0195 19.2636 21.8282 16.2386 26.3109 16.2386V16.2386Z\" fill=\"#EA4335\"/>\n    </svg>\n    <svg class=\"logo-dark\" width=\"18\" height=\"18\" viewBox=\"0 0 48 48\" xmlns=\"http://www.w3.org/2000/svg\">\n      <circle cx=\"24\" cy=\"23\" fill=\"#FFF\" r=\"22\"/>\n      <path d=\"M33.76 34.26c2.75-2.56 4.49-6.37 4.49-11.26 0-.89-.08-1.84-.29-3H24.01v5.99h8.03c-.4 2.02-1.5 3.56-3.07 4.56v.75l3.91 2.97h.88z\" fill=\"#4285F4\"/>\n      <path d=\"M15.58 25.77A8.845 8.845 0 0 0 24 31.86c1.92 0 3.62-.46 4.97-1.31l4.79 3.71C31.14 36.7 27.65 38 24 38c-5.93 0-11.01-3.4-13.45-8.36l.17-1.01 4.06-2.85h.8z\" fill=\"#34A853\"/>\n      <path d=\"M15.59 20.21a8.864 8.864 0 0 0 0 5.58l-5.03 3.86c-.98-2-1.53-4.25-1.53-6.64 0-2.39.55-4.64 1.53-6.64l1-.22 3.81 2.98.22 1.08z\" fill=\"#FBBC05\"/>\n      <path d=\"M24 14.14c2.11 0 4.02.75 5.52 1.98l4.36-4.36C31.22 9.43 27.81 8 24 8c-5.93 0-11.01 3.4-13.45 8.36l5.03 3.85A8.86 8.86 0 0 1 24 14.14z\" fill=\"#EA4335\"/>\n    </svg>\n    <div class=\"gradient-container\"><div class=\"gradient\"></div></div>\n  </div>\n  <div class=\"carousel\">\n    <a class=\"chip\" href=\"https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQFWlFaPf8-fhRmC-i6yw5PdcZcCJ-YUnhvfBHqXGxdq6UyPhZqAWtDaNqweO7gDdEciplteEjZT99E6bXzjpN3dVcuYoito1djINfP_vK-Cruv1u8VuF_GIiO5jSt79CcJh-GbPIR3gzLaHWGJtP7eiCDJU0JEnpEbVB2FW272lF0_it_GT5u_p4x7VA2p43gTcGZz-\">who won euro 2024</a>\n  </div>\n</div>\n"
                },
                "groundingChunks": [
                    {
                        "web": {
                            "uri": "https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQF32Cn9EKHQ9dFx2Ky3mwU7E_Fmj6-Wso3T-qLLXjEBEFqpGHRtZjEAIUaG4-VmFINBfilgzQZ0E7YHbWPFiaA7jlgOQmycrK60DKr4_nzkU4odvA829pix2dRSPEgkAlCLXvLL9hy9YR1qkJo7Fh42QhAYeDHbDj2ojcIV64YbHMsYN3K5xul40POBK8q8XfhRbba-vMh4-k0eLpvfDXJQhqpvK05YdoQYWA==",
                            "title": "uefa.com"
                        }
                    },
                    {
                        "web": {
                            "uri": "https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQGI0rSY8-Xqr_H4NL3v8V70ULcbg8JcQzvrH5bjePk_CRTN06NRlcnzqqEtsaUPtuGRZM_EmeosKkVe0rlHjt15gVsgU_29PFHHK0dOKhyhgqHYJYCSylIUG1JKUtOUrzF2_JKakmU=",
                            "title": "youtube.com"
                        }
                    },
                    {
                        "web": {
                            "uri": "https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQHBWtSMLSJawrVHWZ-iFJu5WRqF2Ahf4YzommFVfCQZUiPEnIFsIueCwx-W-Fp92IPwWDS-_ubqvTmPKrryUsvB-3kHhUnmmAheTjLEwO6YXOF0Msh5QA2o06aeZkVUpQsr14nz5sW1idhJzARV",
                            "title": "wikipedia.org"
                        }
                    },
                    {
                        "web": {
                            "uri": "https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQFmh09VCnFlQxptEy57lm7pjWhtRUPsHWT17R1dKQ_7wPaMU0JxSWWzJ90XoRk2i-dmCv2ToWsBiVmkXu8Iltsagp-owsHehcHD7Q6bgCCZDz0i7Vp1f5Dl0uj3YD8X0cyavpQNTuCWna1xxJmN7vVK-RwicYhRWdjyVDS7hlZhKQ0NpX-gCcNT493JSK_SyZllyLmGmCAgiLCBZFLQQwzBGhUJ4Yj5VTiF_8yYXjIBMQ==",
                            "title": "aljazeera.com"
                        }
                    }
                ],
                "groundingSupports": [
                    {
                        "segment": {
                            "endIndex": 91,
                            "text": "Spain won the UEFA Euro 2024 tournament, defeating England 2-1 in the final held in Berlin."
                        },
                        "groundingChunkIndices": [
                            0,
                            1,
                            2
                        ]
                    },
                    {
                        "segment": {
                            "startIndex": 92,
                            "endIndex": 176,
                            "text": "This victory marked Spain's record-breaking fourth UEFA European Championship title."
                        },
                        "groundingChunkIndices": [
                            2,
                            3
                        ]
                    },
                    {
                        "segment": {
                            "startIndex": 177,
                            "endIndex": 251,
                            "text": "Nico Williams and Mikel Oyarzabal scored the goals for Spain in the final."
                        },
                        "groundingChunkIndices": [
                            1
                        ]
                    },
                    {
                        "segment": {
                            "startIndex": 252,
                            "endIndex": 315,
                            "text": "Spain won all seven of their matches throughout the tournament."
                        },
                        "groundingChunkIndices": [
                            1,
                            2
                        ]
                    }
                ],
                "webSearchQueries": [
                    "who won euro 2024"
                ]
            }
        }
    ],
    "usageMetadata": {
        "promptTokenCount": 11,
        "candidatesTokenCount": 87,
        "totalTokenCount": 414,
        "promptTokensDetails": [
            {
                "modality": "TEXT",
                "tokenCount": 11
            }
        ],
        "toolUsePromptTokenCount": 141,
        "toolUsePromptTokensDetails": [
            {
                "modality": "TEXT",
                "tokenCount": 141
            }
        ],
        "thoughtsTokenCount": 175
    },
    "modelVersion": "gemini-2.5-flash",
    "responseId": "Y-K6aL-vAa2VmtkPgfan2Q0"
}
Modified at 2025-09-05 13:17:33
Previous
Grounding with Google Search
Next
Gemini TTS
Built with