Skip to main content
POST
/
v1beta
/
models
/
{model}
:
{function}
cURL
curl https://api.deerapi.com/v1beta/models/gemini-2.5-flash:generateContent \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DEERAPI_KEY" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "text": "Summarize the benefits of retry logic for production API clients."
          }
        ]
      }
    ]
  }'
{
  "candidates": [
    {
      "content": {
        "role": "<string>",
        "parts": [
          {
            "text": "<string>",
            "thought": true
          }
        ]
      },
      "tokenCount": 123,
      "avgLogprobs": 123,
      "groundingMetadata": {},
      "urlContextMetadata": {},
      "citationMetadata": {},
      "finishMessage": "<string>",
      "index": 123,
      "safetyRatings": [
        {
          "category": "<string>",
          "probability": "<string>"
        }
      ]
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 123,
    "cachedContentTokenCount": 123,
    "candidatesTokenCount": 123,
    "toolUsePromptTokenCount": 123,
    "thoughtsTokenCount": 123,
    "totalTokenCount": 123,
    "promptTokensDetails": [
      {
        "modality": "<string>",
        "tokenCount": 123
      }
    ],
    "candidatesTokensDetails": [
      {
        "modality": "<string>",
        "tokenCount": 123
      }
    ]
  },
  "modelVersion": "<string>",
  "responseId": "<string>",
  "modelStatus": {
    "modelStage": "<string>",
    "retirementTime": "<string>",
    "message": "<string>"
  }
}

Overview

Use this endpoint to call the Gemini Generate Content workflow through DeerAPI. The API reference on this page shows the request schema, response schema, authentication requirements, and runnable examples for the configured endpoint.

Before you start

Use the DeerAPI base URL and pass your API Key in the Authorization header:
https://api.deerapi.com
Authorization: Bearer $DEERAPI_KEY

Model selection

Choose a current model ID from the live pricing page. Model availability changes over time, so avoid copying a model ID from an old project without checking the live list first.

Implementation notes

  • Use the OpenAPI playground for the exact request fields accepted by this endpoint.
  • Keep API Keys on the server side when you build production applications.
  • Log the request ID from failed calls so support can investigate the request.
  • Retry 429, 500, and 503 responses with exponential backoff.

Authorizations

Authorization
string
header
required

Use a DeerAPI API Key as a Bearer token.

Path Parameters

model
string
required

Use this field according to the endpoint schema.

function
string
required

Use this field according to the endpoint schema.

Body

application/json

Use this field according to the endpoint schema.

contents
object[]
required

Use this field according to the endpoint schema.

systemInstruction
object

Use this field according to the endpoint schema.

tools
object[]

Use this field according to the endpoint schema.

toolConfig
object

Use this field according to the endpoint schema.

safetySettings
object[]

Use this field according to the endpoint schema.

cachedContent
string

Use this field according to the endpoint schema.

store
boolean

Use this field according to the endpoint schema.

generationConfig
object

Use this field according to the endpoint schema.

Response

200 - application/json

Use this field according to the endpoint schema.

candidates
object[]

Use this field according to the endpoint schema.

usageMetadata
object

Use this field according to the endpoint schema.

modelVersion
string

Use this field according to the endpoint schema.

responseId
string

Use this field according to the endpoint schema.

modelStatus
object

Use this field according to the endpoint schema.