Generate text with Google Gemini models through Langdock’s public API. Supports normal and streaming completions and is fully compatible with the official Vertex AI SDKs (Python / Node).
Get available models
GET /{region}/v1beta/models/ to retrieve the list of Gemini models.Pick a model & action
generateContent or streamGenerateContent.Send your request
/{region}/v1beta/models/{model}:{action} with your prompt in contents.Handle the response
eu or us)message_start, message_delta, message_stop)/{region}/v1beta/modelsregion must be eu or us.
models/gemini-2.5-flash).["generateContent", "streamGenerateContent"]./{region}/v1beta/models/{model}:{action}models/ prefix).generateContent or streamGenerateContent depending on whether you want to use streaming or not.
Example path: google/eu/v1beta/models/gemini-2.5-flash:streamGenerateContent
GenerateContentRequest structure.
contents (Content[], required)model (string, required)generationConfig (object, optional)temperature (number): Controls randomness (0.0-2.0)topP (number): Nucleus sampling parameter (0.0-1.0)topK (number): Top-k sampling parametercandidateCount (number): Number of response candidates to generatemaxOutputTokens (number): Maximum number of tokens to generatestopSequences (string[]): Sequences that will stop generationresponseMimeType (string): MIME type of the responseresponseSchema (object): Schema for structured outputsafetySettings (SafetySetting[], optional)category (string): The harm category (e.g., “HARM_CATEGORY_HARASSMENT”)threshold (string): The blocking threshold (e.g., “BLOCK_MEDIUM_AND_ABOVE”)tools (Tool[], optional)functionDeclarations array with:
name (string): Function namedescription (string): Function descriptionparameters (object): JSON schema defining function parameterstoolConfig (object, optional)functionCallingConfig with:
mode (string): Function calling mode (“ANY”, “AUTO”, “NONE”)allowedFunctionNames (string[]): Array of allowed function namessystemInstruction (string | Content, optional)toolConfig.functionCallingConfig.allowedFunctionNames is provided, mode must be ANY.streamGenerateContent the endpoint returns an
text/event-stream with compatible events:
• message_start – first chunk that contains contentmessage_delta – subsequent chunksmessage_stop – last chunk (contains finishReason and usage metadata)
Example message_delta event:
@google-cloud/vertexai), Google Generative AI Python library (google-generative-ai), and the Vercel AI SDK for edge streaming.
API key as Bearer token. Format "Bearer YOUR_API_KEY"
API key as Bearer token. Format "Bearer YOUR_API_KEY"
The region of the API to use.
eu, us The model ID (e.g., gemini-2.5-pro, gemini-2.5-flash).
The content to generate a response for.