Skip to main content
POST
/
v1beta
/
models
/
{model}
:generateContent
curl --request POST \
  --url https://api.foxapi.cc/v1beta/models/{model}:generateContent \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Is the weather in Paris good for sightseeing today?"
        }
      ]
    }
  ],
  "tools": [
    {
      "functionDeclarations": [
        {
          "name": "get_weather",
          "description": "Get current weather for a specified city",
          "parameters": {
            "type": "object",
            "properties": {
              "city": {
                "type": "string",
                "description": "City name"
              },
              "unit": {
                "type": "string",
                "enum": [
                  "celsius",
                  "fahrenheit"
                ],
                "description": "Temperature unit"
              }
            },
            "required": [
              "city"
            ]
          }
        }
      ]
    }
  ]
}
'
{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "text": "Hello! How can I help you today?"
          }
        ],
        "role": "model"
      },
      "finishReason": "STOP",
      "safetyRatings": [
        {
          "category": "<string>",
          "probability": "NEGLIGIBLE"
        }
      ]
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 20,
    "candidatesTokenCount": 150,
    "totalTokenCount": 170
  }
}

Authorizations

Authorization
string
header
required

All APIs require Bearer Token authentication

Add to request header:

Authorization: Bearer YOUR_API_KEY

Path Parameters

model
string
required

Model name, e.g. gemini-2.5-flash

Example:

"gemini-2.5-flash"

Body

application/json
contents
object[]
required

The content of the current conversation with the model

systemInstruction
object

System instruction for the model

generationConfig
object

Configuration for generation

tools
object[]

List of tools the model may use

safetySettings
object[]

Safety settings for content filtering

Response

Generate Content response

candidates
object[]

List of generated candidates

usageMetadata
object

Token usage metadata