Skip to main content
Start with the quickstart to verify the address, credentials, and model, then select one complete example. Sources live in the documentation directory’s examples/; copy environment variables from the relevant guide. Run npm ci there for Node examples. See the Python guide for Python setup and the documentation directory’s README.md for complete local checks.

From examples to production

  1. Run documentation validation against local fixtures to check code and page consistency.
  2. Use isolated test settings for one minimal target-deployment request, then verify each required extension separately.
  3. Test business failures, timeouts, streaming interruption, and duplicate submission handling before setting queue, concurrency, and logging policies.
  4. Record target-service results using the production checklist. Local passes do not replace real model verification.
Fields are centralized in the API reference. Check coverage before selecting an endpoint. These scripts work independently of Mintlify’s runtime; retain the same examples and OpenAPI file when migrating documentation platforms. 阅读中文 Prompt caching · Reasoning models · Context management

Files, search, and generation parameters

Confirm model and native-channel support before running; also see data controls.

Audio/video input and text revisions

Each example makes one request. Verify real results with the target model; see troubleshooting.

Tool policies and JSON validation

  • Tool selection and parallel controls: examples/tool-policy.mjs, four policies, at most two turns and one read-only call.
  • JSON mode: examples/json-mode.mjs, Chat / Responses protocols with separate completion and business-field validation.

Native Gemini built-in tools

Three-mode example: examples/gemini-builtins.mjs selects search, URL context, or upstream code execution. One request per run; checks task evidence as well as completion.