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

# MCP Streamable HTTP request

> Handle stateless Streamable HTTP MCP client requests.

Clients authenticate every request with resource-bound `nito_mcp_...` bearer tokens and send JSON-RPC payloads over the configured MCP endpoint. Each POST is independent, so consecutive initialization, notification, discovery, and tool-call requests may be served by different gateway processes without session affinity.



## OpenAPI

````yaml openapi.json POST /mcp
openapi: 3.1.0
info:
  contact:
    email: developers@trynito.ai
    name: Nito Developer Support
    url: https://docs.trynito.ai/support
  description: >-
    Nito developer API: inference, Fusion, model catalog, attestation, web
    retrieval, document parsing, API key management, balance, rate-limit
    snapshots, and MCP.
  termsOfService: https://trynito.ai/terms
  title: Nito API
  version: '2026-07-01'
servers:
  - description: Configured gateway
    url: https://app.trynito.ai
security: []
tags:
  - description: >-
      OpenAI Chat Completions-compatible inference routes backed by gateway
      routing, billing, privacy, and streaming controls.
    name: Chat
  - description: >-
      Stateless OpenAI Responses-compatible shims for agent clients, including
      the compact output-item endpoint used by standalone compaction flows.
    name: Responses
  - description: >-
      Anthropic Messages-compatible request, response, token-count, and
      streaming surfaces mapped into canonical gateway contracts.
    name: Messages
  - description: >-
      Model discovery and browser model-picker metadata for safe logical model
      selection.
    name: Models
  - description: >-
      Request-local Attestation metadata for supported Attestable models in the
      Confidential and Encrypted tiers.
    name: Attestation
  - description: >-
      Streamable HTTP MCP transport documented with resource-bound bearer-token
      authentication.
    name: MCP
  - description: >-
      Standalone, credential-authenticated web search and fetch without an
      inference model.
    name: Web
  - description: >-
      OAuth-authorized organization API key administration with explicit consent
      and current owner/admin authorization.
    name: API Keys
  - description: >-
      Browser billing, usage, referral, balance, auto top-up, and x402 funding
      surfaces using integer nanos.
    name: Billing
externalDocs:
  description: Nito developer documentation
  url: https://docs.trynito.ai/nito
paths:
  /mcp:
    post:
      tags:
        - MCP
      summary: Handle MCP Streamable HTTP POST
      description: >-
        Handle stateless Streamable HTTP MCP client requests.


        Clients authenticate every request with resource-bound `nito_mcp_...`
        bearer tokens and send JSON-RPC payloads over the configured MCP
        endpoint. Each POST is independent, so consecutive initialization,
        notification, discovery, and tool-call requests may be served by
        different gateway processes without session affinity.
      operationId: handleMCPPost
      parameters:
        - description: >-
            Streamable HTTP MCP clients must send both application/json and
            text/event-stream.
          example: application/json, text/event-stream
          in: header
          name: Accept
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            example:
              metadata: example
            schema:
              $ref: '#/components/schemas/MCPRequest'
        description: >-
          Request payload for `handleMCPPost`. Examples use placeholder-safe
          values and do not include real secrets or private prompt content.
        required: true
      responses:
        '200':
          content:
            application/json:
              example:
                metadata: example
              schema:
                additionalProperties: true
                type: object
            text/event-stream:
              example: >+
                data:
                {"jsonrpc":"2.0","id":"mcp_req_test_123","result":{"ok":true}}

              schema:
                type: string
          description: MCP JSON response or Streamable HTTP event stream
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
        '202':
          description: Accepted The response intentionally has no body.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
        '401':
          content:
            application/json:
              example:
                error:
                  code: unauthorized
                  message: authentication required
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: MCP token is missing or invalid
        '403':
          content:
            application/json:
              example:
                error:
                  code: forbidden
                  message: credential is not authorized for this operation
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: MCP token lacks the required scope
        '429':
          content:
            application/json:
              examples:
                insufficient_quota:
                  summary: Billing balance or free-tier quota exhausted
                  value:
                    error:
                      code: insufficient_quota
                      message: insufficient billing balance
                rate_limited:
                  summary: Gateway or provider rate limit exceeded
                  value:
                    error:
                      code: rate_limited
                      message: rate limited
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Rate limited or insufficient quota
          headers:
            Retry-After:
              description: >-
                Seconds to wait before retrying when the gateway can compute a
                retry window.
              example: '60'
              schema:
                type: string
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
      security:
        - MCPBearer: []
components:
  schemas:
    MCPRequest:
      description: >-
        Schema for `MCPRequest` values returned by or accepted by the Nito
        gateway.
      example:
        metadata: example
      oneOf:
        - additionalProperties: true
          description: Nested schema within `MCPRequest` for `MCPRequest.oneOf[0]`.
          type: object
        - description: Nested schema within `MCPRequest` for `MCPRequest.oneOf[1]`.
          items:
            additionalProperties: true
            description: Nested schema within `MCPRequest` for `MCPRequest.oneOf[1].items`.
            type: object
          minItems: 1
          type: array
    ErrorResponse:
      description: >-
        Schema for `ErrorResponse` values returned by or accepted by the Nito
        gateway.
      example:
        error:
          code: invalid_request
          message: The request is invalid.
          param: model
      properties:
        error:
          $ref: '#/components/schemas/Error'
          description: The `error` field on `ErrorResponse`.
          example: example
      required:
        - error
      type: object
    Error:
      description: Schema for `Error` values returned by or accepted by the Nito gateway.
      example:
        code: example
        message: example
        operation_id: 00000000-0000-4000-8000-000000000001
        param: example
      properties:
        code:
          description: The `code` field on `Error`.
          example: example
          type: string
        message:
          description: The `message` field on `Error`.
          example: example
          type: string
        operation_id:
          description: The `operation_id` field on `Error`.
          example: 00000000-0000-4000-8000-000000000001
          type: string
        param:
          description: The `param` field on `Error`.
          example: example
          type: string
      required:
        - message
        - code
      type: object
  headers:
    RateLimitLimit:
      description: Maximum requests for the controlling gateway request-rate bucket.
      schema:
        type: string
    RateLimitRemaining:
      description: >-
        Additional requests immediately available in the controlling gateway
        request-rate bucket.
      schema:
        type: string
    RateLimitReset:
      description: >-
        UTC Unix epoch seconds, rounded up, when the controlling gateway
        request-rate bucket is fully replenished.
      schema:
        type: string
  securitySchemes:
    MCPBearer:
      description: 'Resource-bound MCP token as Authorization: Bearer nito_mcp_...'
      scheme: bearer
      type: http

````

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