Skip to main content
POST
/
models
/
{model}
:generateContent
Generate content using the specified Gemini model
curl --request POST \
  --url https://api.aisa.one/v1/models/{model}:generateContent \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "contents": [
    {
      "parts": [
        {
          "text": "<string>"
        }
      ],
      "role": "system"
    }
  ],
  "tools": [
    {}
  ],
  "toolConfig": {},
  "safetySettings": [
    {}
  ],
  "systemInstruction": {
    "parts": [
      {
        "text": "<string>"
      }
    ],
    "role": "system"
  },
  "generationConfig": {},
  "cachedContent": "<string>"
}
'
{
  "candidates": [
    {
      "parts": [
        {
          "text": "<string>"
        }
      ],
      "role": "system"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

model
string
required

The name of the model to use, format: models/{model}

Body

application/json
contents
object[]
required

Content of the conversation, required

tools
object[]

Optional tools the model can use

toolConfig
object

Optional tool configuration

safetySettings
object[]
systemInstruction
object
generationConfig
object
cachedContent
string

Optional cached content ID

Response

Successful content generation

candidates
object[]