AGTCloud API Docs
GuidesAPI ReferenceIntegrations and resourcesUpdate and help
Text and chat

Gemini Generate Content

Create text, multimodal, tool, and code-execution responses with Gemini Content and Parts.

The Generate Content API uses Content and Parts for text, multimodal, function-calling, and code-execution requests. It returns generated output through Candidates, Usage Metadata, and safety information. Requests use Bearer API key authentication. Supported input modalities, tools, and advanced generation parameters depend on the selected model.

POST/v1beta/models/{model}:generateContent

Use Gemini Content and Parts structures to generate text, multimodal, function calls, or code execution responses.

Authorization

bearerAuth
AuthorizationBearer <token>

Use Bearer your-api-key in the Authorization Header.

In: header

Path Parameters

model*string

Model ID used to generate content. The path automatically forms models/{model}.

Default"MODEL_ID"

Request Body

Gemini uses Content and Parts to represent text, multimodal input, tools, and generation settings.

application/json
Text chat

Use user and model Content objects to organize single-turn or multi-turn text conversations.

contents[]
Conversation content in chronological order.
parts[].text
Text content in each message.
role
Message author; commonly user or model.
application/json
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Hello! Please introduce yourself."
        }
      ]
    }
  ]
}
Field referenceThe complete field set is unchanged; descriptions emphasize the current use case.

Use Content objects and text Parts to organize single-turn or multi-turn text conversations.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

Google Gemini Generate Content documentationReview the upstream protocol and recent field changes.