Overview

predictor.sh exposes OpenAI-compatible and ElevenLabs-compatible APIs, allowing you to use existing SDKs and tools.

Base URL

Your endpoint URL is displayed when you start predictor:

https://abc123.predictor.sh

All API endpoints are relative to this base URL.

Authentication

All requests require a Bearer token in the Authorization header:

curl https://abc123.predictor.sh/v1/chat/completions \
  -H "Authorization: Bearer pred_your_token"

Available Endpoints

Text Generation

Endpoint
Method
Description

/v1/chat/completions

POST

Chat completions

/v1/completions

POST

Text completions

/v1/embeddings

POST

Text embeddings

/v1/models

GET

List models

/health

GET

Health check

Speech-to-Text

Endpoint
Method
Description

/v1/audio/transcriptions

POST

Transcribe audio

Text-to-Speech

Endpoint
Method
Description

/v1/audio/speech

POST

Generate speech (OpenAI)

/v1/text-to-speech/{voice_id}

POST

Generate speech (ElevenLabs)

/v1/text-to-speech/{voice_id}/stream

POST

Streaming speech

/v1/voices

GET

List voices

SDK Compatibility

OpenAI Python SDK

OpenAI JavaScript SDK

curl

Error Responses

Errors follow the OpenAI error format:

HTTP Status Codes

Code
Description

200

Success

400

Bad request (invalid parameters)

401

Unauthorized (invalid/missing token)

403

Forbidden (IP not allowed)

429

Too many requests

500

Server error

502

Tunnel connection lost

503

Endpoint offline

504

Request timeout

Last updated