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 Hangzhou good for going out today?"
        }
      ]
    }
  ],
  "tools": [
    {
      "functionDeclarations": [
        {
          "name": "get_weather",
          "description": "Get current weather information 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": "<string>"
        }
      ]
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 25,
    "candidatesTokenCount": 150,
    "totalTokenCount": 175
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.foxapi.cc/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

All endpoints require Bearer Token authentication

Add the following to your 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

List of conversation contents

systemInstruction
object

System instruction

generationConfig
object

Generation configuration

tools
object[]

List of available tools

safetySettings
object[]

Safety settings

Response

Content generation response

candidates
object[]

List of candidate results

usageMetadata
object

Usage statistics