Skip to main content
Methods: generateText(), createChatCompletion()

Example

Key parameters

  • model (required): Target model id.
  • messages (required): Ordered messages with roles system|user|assistant|tool; content as MessageContent objects.
  • Sampling: temperature (0–2), top_p (0–1), top_k (>=1), seed (int, optional).
  • Length/penalties: max_output_tokens (int), presence_penalty and frequency_penalty (-2 to 2), stop (string|string[]).
  • Tools: tools (definitions), tool_choice (auto/none/specific tool), max_tool_calls (int), parallel_tool_calls (bool).
  • Logprobs: logprobs (bool), top_logprobs (0–20).
  • Output: response_format (json/text), meta (bool to include meta block), stream (bool), service_tier.
  • Gateway extras: usage (bool to request usage).

Returns

ChatCompletionsResponse JSON object.
Last modified on July 26, 2026