Skip to main content
generateContent is Gemini’s native interface (v1beta). The model ID is part of the path; the body carries text, images, audio, video and files in contents, and generationConfig controls the output and thinking. The Google Gen AI SDKs connect by changing the base URL and the API Key.

Models

Gemini models take text, image, video, audio and PDF input, return text, and support thinking (generationConfig.thinkingConfig). Context window and max output are in tokens, as published by each model’s vendor. Gemini image models (the Nano Banana family) use the same endpoint, see Image generation. The full list with prices is in the model catalog; GET /v1/models lists the models your API Key can use.

Endpoints

The base URL is https://api.dreamto.ai. Create an API Key in the DreamTo console; see Authentication.

Quick start

Streaming

Replace :generateContent in the path with :streamGenerateContent?alt=sse and the reply arrives as server-sent events, each data frame a GenerateContentResponse.
cURL

Notes

  • The API Key goes in the x-goog-api-key header, the ?key= query parameter, or Authorization: Bearer.
  • The model ID belongs in the path only; do not send a model field in the body.
  • generateContent and streamGenerateContent are available; countTokens, embedContent, Files, caching (cachedContents) and batch endpoints are not.
  • Errors use one common structure, see Errors.