Opper AI Spans API

The Spans API from Opper AI — 3 operation(s) for spans.

Operations 6

POST /v3/spans Create span #
DELETE /v3/spans/{id} Delete span #
GET /v3/spans/{id} Get span #
PATCH /v3/spans/{id} Update span #
GET /v3/spans/{id}/events List span events #
POST /v3/spans/{id}/events Create span event #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/opper:opper-spans-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

opper-spans-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: Schema-driven generative API that orchestrates LLM-powered workflows.
  title: Task Spans API
  version: 3.0.0
servers:
- description: Production
  url: https://api.opper.ai
- description: Local development
  url: http://localhost:8080
security:
- BearerAuth: []
tags:
- name: Spans
paths:
  /v3/spans:
    post:
      description: Create a new trace span.
      operationId: createSpan
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSpanRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSpanResponse'
          description: Successful response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad request
        '401':
          description: Unauthorized - missing or invalid API key
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal server error
      summary: Create span
      tags:
      - Spans
  /v3/spans/{id}:
    delete:
      description: Delete a trace span.
      operationId: deleteSpan
      parameters:
      - description: Generation ID
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No content
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad request
        '401':
          description: Unauthorized - missing or invalid API key
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal server error
      summary: Delete span
      tags:
      - Spans
    get:
      description: Get a trace span by ID.
      operationId: getSpan
      parameters:
      - description: Generation ID
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSpanResponse'
          description: Successful response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad request
        '401':
          description: Unauthorized - missing or invalid API key
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal server error
      summary: Get span
      tags:
      - Spans
    patch:
      description: Update an existing trace span.
      operationId: updateSpan
      parameters:
      - description: Generation ID
        in: path
        name: id
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSpanRequest'
        required: true
      responses:
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad request
        '401':
          description: Unauthorized - missing or invalid API key
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal server error
      summary: Update span
      tags:
      - Spans
  /v3/spans/{id}/events:
    get:
      description: List events for a span.
      operationId: listSpanEvents
      parameters:
      - description: Generation ID
        in: path
        name: id
        required: true
        schema:
          type: string
      - description: Filter by event kind (guardrail, feedback, evaluation)
        in: query
        name: kind
        schema:
          type: string
      responses:
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad request
        '401':
          description: Unauthorized - missing or invalid API key
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal server error
      summary: List span events
      tags:
      - Spans
    post:
      description: Record an event (guardrail, feedback, evaluation) on a span.
      operationId: createSpanEvent
      parameters:
      - description: Generation ID
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad request
        '401':
          description: Unauthorized - missing or invalid API key
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal server error
      summary: Create span event
      tags:
      - Spans
components:
  schemas:
    GetSpanResponse:
      properties:
        data:
          properties:
            data:
              properties:
                cost:
                  type: number
                evaluations:
                  items:
                    properties:
                      cost:
                        type: number
                      created_at:
                        type: string
                      duration_ms:
                        type: integer
                      evaluator_type:
                        type: string
                      explanation:
                        type: string
                      flagged:
                        type: boolean
                      generation_id:
                        type: string
                      id:
                        type: string
                      model:
                        type: string
                      rule_id:
                        type: string
                      score:
                        type: number
                    required:
                    - id
                    - generation_id
                    - flagged
                    - created_at
                    type: object
                  type: array
                function:
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                  required:
                  - id
                  - name
                  type: object
                generation_id:
                  type: string
                input_truncated:
                  type: boolean
                instructions:
                  type: string
                model:
                  type: string
                observations:
                  type: string
                output_truncated:
                  type: boolean
                score:
                  type: integer
                scorer_context:
                  type: object
                tags:
                  type: object
                total_tokens:
                  type: integer
              type: object
            end_time:
              format: date-time
              type: string
            error:
              type: string
            id:
              type: string
            input:
              description: Any value
            meta:
              type: object
            metadata:
              type: object
            metrics:
              items:
                properties:
                  comment:
                    type: string
                  created_at:
                    type: string
                  dimension:
                    type: string
                  id:
                    type: string
                  value:
                    type: number
                required:
                - id
                - dimension
                - value
                - created_at
                type: object
              type: array
            name:
              type: string
            output:
              description: Any value
            parent_id:
              type: string
            score:
              type: integer
            start_time:
              format: date-time
              type: string
            status:
              type: string
            tags:
              type: object
            trace_id:
              type: string
            type:
              type: string
          required:
          - id
          - trace_id
          - name
          type: object
      required:
      - data
      type: object
    CreateSpanRequest:
      properties:
        end_time:
          format: date-time
          type: string
        error:
          type: string
        input:
          type: string
        meta:
          type: object
        metadata:
          type: object
        name:
          type: string
        output:
          type: string
        parent_id:
          type: string
        start_time:
          format: date-time
          type: string
        tags:
          type: object
        trace_id:
          type: string
        type:
          type: string
      required:
      - name
      type: object
    UpdateSpanRequest:
      properties:
        end_time:
          format: date-time
          type: string
        error:
          type: string
        meta:
          type: object
        metadata:
          type: object
        output:
          type: string
        tags:
          type: object
      type: object
    ErrorResponse:
      properties:
        error:
          properties:
            code:
              type: string
            details:
              description: Any value
            message:
              type: string
          required:
          - code
          - message
          type: object
        meta:
          type: object
      required:
      - error
      type: object
    CreateSpanResponse:
      properties:
        data:
          properties:
            id:
              type: string
            name:
              type: string
            parent_id:
              type: string
            trace_id:
              type: string
            type:
              type: string
          required:
          - id
          - trace_id
          - name
          type: object
      required:
      - data
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: API Key
      description: API key authentication. Pass your API key as a Bearer token.
      scheme: bearer
      type: http
    MCPBearer:
      description: Delegated user OAuth access token for the Opper MCP resource. Obtain through advertised OAuth authorization; runtime and management service keys are not accepted.
      scheme: bearer
      type: http
    ManagementBearer:
      bearerFormat: Management API Key
      description: Management API authentication. Pass an `op-mak-…` management token as a Bearer token. Runtime `op-…` API keys are rejected with 403 — they belong on the data-plane endpoints. Mint a management key from the platform UI under Settings → API keys.
      scheme: bearer
      type: http