> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aixy-gateway.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tool Call

> Execute an approved action once per execution ID (24-hour duplicate protection).



## OpenAPI

````yaml /openapi.json post /api/playground/tool-calls
openapi: 3.1.0
info:
  title: Aixy Gateway API
  version: 0.1.0
  description: >-
    Route requests to configured AI providers through OpenAI- and
    Anthropic-compatible APIs. Aixy applies project access, model policies,
    guardrails, routing, budgets, and usage attribution before forwarding
    inference traffic.
servers:
  - url: https://api.aixy-gateway.com
    description: Aixy production gateway
security: []
tags:
  - name: operations
    description: Check process liveness and traffic readiness.
  - name: authentication
    description: Authenticate trusted server-side clients.
  - name: organizations
    description: Manage the organization and its lifecycle.
  - name: projects
    description: Create projects and manage project membership.
  - name: users
    description: Manage organization users, roles, and invitations.
  - name: teams
    description: Manage teams and team membership.
  - name: api-keys
    description: Manage project-scoped gateway API keys.
  - name: provider-credentials
    description: Manage organization and project provider credentials.
  - name: provider-catalog
    description: Discover providers supported by the gateway.
  - name: provider-models
    description: Discover and control models exposed by configured providers.
  - name: routing
    description: Configure stable model aliases, routing strategies, and fallbacks.
  - name: guardrails
    description: Configure prompt and sensitive-data protection policies.
  - name: identity connections
    description: Configure tenant-scoped enterprise identity federation.
  - name: playground
    description: Exercise configured models through the gateway.
  - name: cost-control
    description: Inspect spend and enforce budgets across tenant scopes.
  - name: metrics
    description: Inspect usage, token, latency, and error metrics.
  - name: activity
    description: Diagnose individual model requests and manage opt-in content capture.
  - name: monitors
    description: Configure operational monitors and notification channels.
  - name: audit
    description: Query, verify, and export the organization audit log.
  - name: telemetry exports
    description: Export telemetry to organization-owned destinations.
  - name: billing
    description: Inspect and manage the organization subscription.
  - name: models
    description: List models available to a project-scoped gateway API key.
  - name: inference
    description: Run model inference through the Aixy data plane.
  - name: pricing
    description: Manage versioned pricing attribution rules.
  - name: system
    description: Discover gateway capabilities and providers.
  - name: MCP beta
    description: Mcp beta operations exposed by the gateway.
  - name: cost-optimization
    description: Cost optimization operations exposed by the gateway.
  - name: custom domains
    description: Custom domains operations exposed by the gateway.
  - name: data processing
    description: Data processing operations exposed by the gateway.
  - name: feature flags
    description: Feature flags operations exposed by the gateway.
  - name: privacy
    description: Privacy operations exposed by the gateway.
  - name: roles
    description: Roles operations exposed by the gateway.
paths:
  /api/playground/tool-calls:
    post:
      tags:
        - playground
      summary: Tool Call
      description: >-
        Execute an approved action once per execution ID (24-hour duplicate
        protection).
      operationId: playground_tool_call
      parameters:
        - name: X-Aixy-Tool-Context
          in: header
          required: true
          schema:
            type: string
            format: uuid
            title: X-Aixy-Tool-Context
        - name: X-Aixy-Session-ID
          in: header
          required: false
          description: >-
            Optional Activity conversation ID shared with model rounds. Invalid
            IDs are ignored; the selected key supplies scope.
          schema:
            type: string
            maxLength: 128
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlaygroundToolCallRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlaygroundToolResultResponse'
        '400':
          description: The request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '401':
          description: Authentication is required or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '403':
          description: The authenticated account cannot perform this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '404':
          description: The requested resource does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '409':
          description: The request conflicts with the current resource state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '413':
          description: The request body exceeds the endpoint limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '422':
          description: The request is semantically invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '429':
          description: The request was rate limited.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '502':
          description: An external dependency returned an invalid response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '503':
          description: The control-plane capability is unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '504':
          description: An external dependency timed out.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        4XX:
          description: The request was rejected by validation or authorization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
      security:
        - BrowserSession: []
components:
  schemas:
    PlaygroundToolCallRequest:
      properties:
        model:
          type: string
          title: Model
        endpoint:
          $ref: '#/components/schemas/PlaygroundEndpoint'
          default: chat/completions
        api_key_id:
          type: string
          format: uuid
          title: Api Key Id
        project_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Project Id
        server_ids:
          items:
            type: string
            format: uuid
          type: array
          maxItems: 20
          minItems: 1
          title: Server Ids
        name:
          type: string
          pattern: ^[a-z0-9_]{1,65}\.[a-z0-9_]{1,60}$
          title: Name
        arguments:
          additionalProperties: true
          type: object
          title: Arguments
        execution_id:
          type: string
          format: uuid
          title: Execution Id
          description: >-
            A unique UUID for this proposed action. Reuse it after an uncertain
            submission; duplicates are rejected for 24 hours.
        server_revision:
          type: integer
          minimum: 1
          title: Server Revision
        definition_revision:
          type: string
          pattern: ^[0-9a-f]{64}$
          title: Definition Revision
        approved:
          type: boolean
          title: Approved
      additionalProperties: false
      type: object
      required:
        - model
        - api_key_id
        - server_ids
        - name
        - arguments
        - execution_id
        - server_revision
        - definition_revision
        - approved
      title: PlaygroundToolCallRequest
    PlaygroundToolResultResponse:
      properties:
        content:
          type: string
          title: Content
        is_error:
          type: boolean
          title: Is Error
        duration_ms:
          type: integer
          title: Duration Ms
      type: object
      required:
        - content
        - is_error
        - duration_ms
      title: PlaygroundToolResultResponse
    GatewayErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/GatewayErrorDetail'
      type: object
      required:
        - error
      title: GatewayErrorResponse
    PlaygroundEndpoint:
      type: string
      enum:
        - chat/completions
        - responses
        - messages
    GatewayErrorDetail:
      properties:
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
      type: object
      required:
        - code
        - message
      title: GatewayErrorDetail
  securitySchemes:
    BrowserSession:
      type: apiKey
      description: Secure same-origin browser session cookie.
      in: cookie
      name: gateway_session

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.