Gemini.Client.HTTP (GeminiEx v0.9.0)

Copy Markdown View Source

HTTP client for both Gemini and Vertex AI APIs using Req.

Supports multiple authentication strategies for regular (non-streaming) HTTP requests. For streaming requests, see Gemini.Client.HTTPStreaming.

Rate Limiting

All requests are automatically routed through the rate limiter unless disable_rate_limiter: true is passed in options. The rate limiter:

  • Enforces concurrency limits per model
  • Honors 429 RetryInfo delays from the API
  • Retries transient failures with backoff
  • Tracks token usage for budget estimation

See Gemini.RateLimiter for configuration options.

Summary

Functions

Make a DELETE request using the configured authentication.

Make a GET request using the configured authentication.

Make a PATCH request using the configured authentication.

Make a POST request using the configured authentication.

Make an authenticated HTTP request.

Functions

delete(path, opts \\ [])

Make a DELETE request using the configured authentication.

get(path, opts \\ [])

Make a GET request using the configured authentication.

patch(path, body, opts \\ [])

Make a PATCH request using the configured authentication.

post(path, body, opts \\ [])

Make a POST request using the configured authentication.

request(method, path, body, auth_config, opts \\ [])

Make an authenticated HTTP request.

Options

In addition to standard request options, supports rate limiter options:

  • :disable_rate_limiter - Bypass rate limiting (default: false)
  • :non_blocking - Return immediately if rate limited (default: false)
  • :max_concurrency_per_model - Override concurrency limit