Skip to main content

API Reference

Teale exposes a local HTTP API for controlling the node, running inference, and managing network resources. The API is OpenAI-compatible for chat completions and model listing, making it a drop-in replacement for applications that already target the OpenAI API.

Base URL

http://localhost:11435

The port is configurable via the --port flag when starting the node.

Authentication

Authentication is optional by default. When allow_network_access is enabled in settings, an API key is required for all requests except GET /health.

Pass the API key via the Authorization header:

Authorization: Bearer <your-api-key>

Generate API keys using the POST /v1/app/apikeys endpoint or the teale apikeys generate CLI command.

Response Format

All responses are JSON. Successful responses return the relevant resource object directly. Errors return a standard error envelope:

{
"error": {
"message": "Model not found: invalid-model-id",
"type": "not_found"
}
}

OpenAI Compatibility

The following endpoints are fully OpenAI-compatible:

EndpointDescription
POST /v1/chat/completionsChat completions (streaming and non-streaming)
GET /v1/modelsList available models

This means you can point any OpenAI SDK client at your Teale node by setting the base URL:

from openai import OpenAI

client = OpenAI(
base_url="http://localhost:11435/v1",
api_key="your-api-key" # or "not-needed" if auth is disabled
)

Endpoint Overview

OpenAI-Compatible

MethodPathDescription
POST/v1/chat/completionsChat completions
GET/v1/modelsList available models

Health

MethodPathDescription
GET/healthHealth check

App State

MethodPathDescription
GET/v1/appFull app state snapshot
PATCH/v1/app/settingsUpdate settings

Models

MethodPathDescription
POST/v1/app/models/loadLoad model into GPU
POST/v1/app/models/downloadDownload a model
POST/v1/app/models/unloadUnload current model

Peers

MethodPathDescription
GET/v1/app/peersList connected peers

Private TealeNet (PTN)

MethodPathDescription
GET/v1/app/ptnList PTN memberships
POST/v1/app/ptn/createCreate a PTN
POST/v1/app/ptn/inviteGenerate invite code
POST/v1/app/ptn/issue-certIssue membership certificate
POST/v1/app/ptn/join-with-certJoin PTN with certificate
POST/v1/app/ptn/leaveLeave a PTN
POST/v1/app/ptn/promote-adminPromote member to admin
POST/v1/app/ptn/import-ca-keyImport CA signing key
POST/v1/app/ptn/recoverRecover PTN membership

Wallet

MethodPathDescription
GET/v1/app/walletWallet balance
GET/v1/app/wallet/transactionsTransaction history
POST/v1/app/wallet/sendSend credits to a peer
GET/v1/app/wallet/solanaSolana wallet status

Agent

MethodPathDescription
GET/v1/app/agent/profileAgent profile
GET/v1/app/agent/directoryAgent directory
GET/v1/app/agent/conversationsAgent conversations

API Keys

MethodPathDescription
GET/v1/app/apikeysList API keys
POST/v1/app/apikeysGenerate a new API key
POST/v1/app/apikeys/revokeRevoke an API key