AI Gateway Batches API

The Batches API from AI Gateway — 2 operation(s) for batches.

OpenAPI Specification

ai-gateway-batches-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Portkey AI Gateway Analytics Batches API
  version: 1.0.0
  description: REST API for the Portkey AI Gateway, exposing OpenAI-compatible inference endpoints (chat, completions, embeddings, images, audio, files, batches, fine-tuning, assistants and threads, prompts, responses) plus admin endpoints for analytics, configs, API keys, integrations, providers, virtual keys, guardrails, policies, prompt management, workspaces, MCP, logs, and feedback. Selected as the canonical "AI gateway" exemplar for this index entry; the broader landscape is catalogued in apis.yml.
  contact:
    name: Portkey
    url: https://portkey.ai/docs/
servers:
- url: https://api.portkey.ai/v1
  description: Production inference and admin API
security:
- PortkeyApiKey: []
  PortkeyProvider: []
tags:
- name: Batches
paths:
  /batches:
    post:
      tags:
      - Batches
      summary: Create a batch job
      responses:
        '200':
          description: Batch created
    get:
      tags:
      - Batches
      summary: List batches
      responses:
        '200':
          description: Batches
  /batches/{id}:
    get:
      tags:
      - Batches
      summary: Retrieve a batch
      parameters:
      - $ref: '#/components/parameters/Id'
      responses:
        '200':
          description: Batch
    delete:
      tags:
      - Batches
      summary: Cancel a batch
      parameters:
      - $ref: '#/components/parameters/Id'
      responses:
        '200':
          description: Cancelled
components:
  parameters:
    Id:
      name: id
      in: path
      required: true
      schema:
        type: string
  securitySchemes:
    PortkeyApiKey:
      type: apiKey
      in: header
      name: x-portkey-api-key
      description: Portkey API key header.
    PortkeyProvider:
      type: apiKey
      in: header
      name: x-portkey-provider
      description: Upstream provider selector header.