OpenRelay Files API

Input and result files for the Batch API (JSONL, up to 200 MB and 50,000 records). Served by the inference endpoint (inference.openrelay.inc).

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 5

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /v1/files Upload a JSONL file for batch input · Upload a JSONL input file for the Batch API #
Ask an LLM
“How do I send a JSONL file of requests for the batch API?”
“What is the maximum size of a batch input file?”
Tell an agent
Upload {file} as a batch input file with purpose {purpose}.
Send {file} for batch processing.
POST /v1/files/presign Get a signed URL to upload a JSONL file · Mint a signed URL for a direct JSONL upload #
Ask an LLM
“Can a browser upload a JSONL file directly to storage without going through the API?”
“How long is a presigned upload URL valid?”
Tell an agent
Mint a signed URL for a {bytes} byte file named {filename}.
Give me a presigned upload URL for {bytes} bytes.
GET /v1/files/{id} Get a file's metadata · Get a file's metadata #
Ask an LLM
“What is the status of a file I uploaded?”
“Can I look up a file by its ID?”
Tell an agent
Get file {id}.
Show the metadata of uploaded file {id}.
POST /v1/files/{id}/complete Register a presigned upload · Register a presigned upload after the PUT succeeds #
Ask an LLM
“How do I finish a file upload after the PUT to the signed URL succeeds?”
“Is completing a presigned upload idempotent?”
Tell an agent
Complete the upload of file {id}.
Register the uploaded object {id} as a batch input file.
GET /v1/files/{id}/content Download a file's raw JSONL content · Download a file's raw JSONL content #
Ask an LLM
“Where do I get the raw JSONL lines of a batch result file?”
“Can I stream a file's content back to my client?”
Tell an agent
Download the content of file {id}.
Stream the raw JSONL lines of {id}.

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/openrelay:openrelay-files-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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

openrelay-files-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: The OpenRelay control-plane REST API. Deploy GPU VMs and inference clusters, manage organizations and billing, and automate your infrastructure. All requests are authenticated with an API key (`vl_…`) unless noted otherwise.
  title: OpenRelay Files API
  version: 0.1.0
servers:
- description: Production
  url: https://api.openrelay.inc
- description: Beta
  url: https://api.beta.openrelay.inc
- description: Local development
  url: http://localhost:8083
tags:
- description: Input and result files for the Batch API (JSONL, up to 200 MB and 50,000 records). Served by the inference endpoint (inference.openrelay.inc).
  name: Files
paths:
  /v1/files:
    servers:
    - description: Production
      url: https://inference.openrelay.inc
    - description: Beta
      url: https://inference.beta.openrelay.inc
    post:
      description: Send multipart/form-data with a `file` part (the JSONL bytes, up to 200 MB and 50,000 records) and a `purpose` field set to `batch`. Each line is one request object; the returned file id goes in `input_file_id` when creating a batch.
      operationId: uploadFile
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                file:
                  description: The JSONL file contents.
                  format: binary
                  type: string
                purpose:
                  enum:
                  - batch
                  type: string
              required:
              - file
              - purpose
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileObject'
          description: OK
        '400':
          $ref: '#/components/responses/InferenceBadRequest'
        '401':
          $ref: '#/components/responses/InferenceUnauthorized'
        '404':
          $ref: '#/components/responses/InferenceNotFound'
        '413':
          $ref: '#/components/responses/InferenceTooLarge'
        '429':
          $ref: '#/components/responses/InferenceRateLimited'
      security:
      - apiKey: []
      summary: Upload a JSONL input file for the Batch API
      tags:
      - Files
      x-openrelay-mcp:
        exclude: true
  /v1/files/presign:
    servers:
    - description: Production
      url: https://inference.openrelay.inc
    - description: Beta
      url: https://inference.beta.openrelay.inc
    post:
      description: 'For browser clients that upload the file straight to storage instead of through the API: returns a file id and a signed PUT URL (valid 15 minutes). After the PUT succeeds, register the file with the complete call. CLI and SDK clients should use the plain upload instead.'
      operationId: presignFileUpload
      requestBody:
        content:
          application/json:
            schema:
              properties:
                bytes:
                  description: Exact size of the upcoming upload in bytes (max 200 MB).
                  format: int64
                  type: integer
                filename:
                  description: Display name; not persisted.
                  type: string
              required:
              - bytes
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PresignUploadResponse'
          description: OK
        '400':
          $ref: '#/components/responses/InferenceBadRequest'
        '401':
          $ref: '#/components/responses/InferenceUnauthorized'
        '404':
          $ref: '#/components/responses/InferenceNotFound'
      security:
      - apiKey: []
      summary: Mint a signed URL for a direct JSONL upload
      tags:
      - Files
      x-openrelay-cli:
        hidden: true
      x-openrelay-mcp:
        exclude: true
  /v1/files/{id}:
    servers:
    - description: Production
      url: https://inference.openrelay.inc
    - description: Beta
      url: https://inference.beta.openrelay.inc
    get:
      operationId: getFile
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileObject'
          description: OK
        '401':
          $ref: '#/components/responses/InferenceUnauthorized'
        '404':
          $ref: '#/components/responses/InferenceNotFound'
      security:
      - apiKey: []
      summary: Get a file's metadata
      tags:
      - Files
  /v1/files/{id}/complete:
    servers:
    - description: Production
      url: https://inference.openrelay.inc
    - description: Beta
      url: https://inference.beta.openrelay.inc
    post:
      description: Validates the uploaded object (size, line count) and registers it as a batch input file. Idempotent; completing an already-registered id returns the existing file.
      operationId: completeFileUpload
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileObject'
          description: OK
        '400':
          $ref: '#/components/responses/InferenceBadRequest'
        '401':
          $ref: '#/components/responses/InferenceUnauthorized'
        '404':
          $ref: '#/components/responses/InferenceNotFound'
      security:
      - apiKey: []
      summary: Register a presigned upload after the PUT succeeds
      tags:
      - Files
      x-openrelay-cli:
        hidden: true
      x-openrelay-mcp:
        exclude: true
  /v1/files/{id}/content:
    servers:
    - description: Production
      url: https://inference.openrelay.inc
    - description: Beta
      url: https://inference.beta.openrelay.inc
    get:
      description: 'Streams the file bytes. Use it to fetch batch results: the batch object''s output_file_id (successful records) and error_file_id (failed records) each point at a JSONL file of `{custom_id, response | error}` lines.'
      operationId: getFileContent
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/octet-stream:
              schema:
                format: binary
                type: string
          description: The file's raw JSONL bytes
        '401':
          $ref: '#/components/responses/InferenceUnauthorized'
        '404':
          $ref: '#/components/responses/InferenceNotFound'
      security:
      - apiKey: []
      summary: Download a file's raw JSONL content
      tags:
      - Files
      x-openrelay-mcp:
        exclude: true
components:
  responses:
    InferenceTooLarge:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InferenceError'
      description: The upload exceeds the 200 MB limit
    InferenceBadRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InferenceError'
      description: The request is invalid
    InferenceUnauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InferenceError'
      description: Missing or invalid API key
    InferenceNotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InferenceError'
      description: Not found (also returned when the organization does not have Batch API access)
    InferenceRateLimited:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InferenceError'
      description: Too many concurrent uploads; retry shortly
  schemas:
    InferenceError:
      description: Error shape returned by the inference endpoint (OpenAI-compatible).
      properties:
        error:
          properties:
            code:
              description: Machine code for the specific failure.
              type: string
            message:
              description: Human-readable explanation.
              type: string
            type:
              description: Error class, e.g. invalid_request_error.
              type: string
          required:
          - message
          - type
          type: object
      required:
      - error
      type: object
    PresignUploadResponse:
      description: A minted file id and a signed URL for a direct browser upload.
      properties:
        expires_at:
          description: Unix timestamp (seconds) the signed URL stops working.
          format: int64
          type: integer
        file_id:
          description: File id to register with the complete call after the PUT succeeds.
          type: string
        put_url:
          description: Signed URL; PUT the raw JSONL bytes to it.
          type: string
      required:
      - file_id
      - put_url
      - expires_at
      type: object
    FileObject:
      description: A file stored for the Batch API (OpenAI-compatible).
      properties:
        bytes:
          description: File size in bytes.
          format: int64
          type: integer
        created_at:
          description: Unix timestamp (seconds).
          format: int64
          type: integer
        expires_at:
          description: Unix timestamp (seconds); files are retained for 30 days.
          format: int64
          type: integer
        filename:
          type: string
        id:
          description: File id (file-…). Pass it as input_file_id when creating a batch.
          type: string
        object:
          enum:
          - file
          type: string
        purpose:
          description: '"batch" for inputs, "batch_output" / "batch_error" for result files.'
          type: string
      required:
      - id
      - object
      - bytes
      - created_at
      - filename
      - purpose
      type: object
  securitySchemes:
    apiKey:
      description: 'OpenRelay API key. Send it as `Authorization: Bearer vl_…`.'
      scheme: bearer
      type: http