cURL
single-turn
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": "Explain the core principles of the Transformer architecture" } ] } ] } '
{ "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 } }
Add to request header:
Authorization: Bearer YOUR_API_KEY
Model name, e.g. gemini-2.5-flash
"gemini-2.5-flash"
The content of the current conversation with the model
Show child attributes
System instruction for the model
Configuration for generation
List of tools the model may use
Safety settings for content filtering
Generate Content response
List of generated candidates
Token usage metadata