GeminiGemini
Demo environmentGet API key
  • Overview
  • Crypto Trading
  • Prediction Markets
  • Perpetuals
  • Stocks
  • API Reference
  • SDKs & Tools
Changelog
Gemini logoGemini logo

© 2026 Gemini Space Station, Inc.

Get started
    IntroductionDemo environment
Platform
    Platform overview
    Authentication
      API keysOAuth 2.0
    AccountsRoles & permissionsInstruments & symbolsClient order IDsRate limitsErrors
Build with Gemini
    Build an agent
Resources
Build with Gemini

Build an agent

Build an agent on Gemini's current APIs by combining canonical documentation, explicit account context, the minimum required permissions, and confirmation before side effects.

Tooling status: Gemini's open-source MCP server and packaged agent skills are available now. SDK packages and a dedicated Gemini API CLI are still in development.

Start with current interfaces

Use the API Reference to select a documented REST, WebSocket, or FIX capability. Agents and other LLM clients can discover the published documentation through llms.txt, or use the current MCP server and agent skills.

Choose authentication only after choosing the operation:

  • API key authentication
  • OAuth
  • Roles and permissions

Credential support and account selection vary by interface. Do not assume that credential identity alone selects a trading account.

Resolve intent before acting

For each requested operation, an agent should determine:

  1. The trading product and capability the user intends.
  2. Whether the operation is read-only or has side effects.
  3. Which credential type, role, or OAuth scope the operation requires.
  4. Which account the operation will use according to the interface's documented behavior.
  5. Whether that account can use the product and has the required balance or collateral.
  6. Whether the operation supports a documented preview or validation step.

If more than one account could satisfy the request, ask the user to choose. Do not create an undocumented default-selection rule.

Guard mutating operations

Before placing or cancelling an order, transferring funds, or making another state-changing request:

  • Restate the product, instrument, side effect, and resolved account.
  • Show material order or transfer parameters without exposing secrets.
  • Use a documented preview when one exists.
  • Ask for confirmation at the point of execution.
  • Record the returned identifier and monitor the documented status or event stream.
  • Stop on ambiguous account context, missing permission, unsupported product access, or an undocumented operation.

Keep credentials out of prompts, logs, generated source, and tool output. Give the agent only the role or scope required for its workflow.

Isolate and test

Use accounts and subaccounts when the documented account model fits the required isolation boundary. Use the demo environment only for products and operations explicitly documented there, and test both success and refusal paths before using production credentials.

Agent tooling

SDKs & Tools documents the available Gemini API MCP server, API samples, and agent skills. SDK packages and a dedicated Gemini API CLI will be added as they are released. Treat documentation retrieval and trading execution as distinct capabilities, and verify availability, permissions, account selection, and confirmation behavior before invoking a mutating tool.

ErrorsBuild an agent
On this page
  • Start with current interfaces
  • Resolve intent before acting
  • Guard mutating operations
  • Isolate and test
  • Agent tooling