API Reference

Excellent! Below is a detailed and well-structured API Reference section for the Uniport AI Docs, covering all the submenus with comprehensive content, developer-friendly guidance, and examples.


📑 API Reference


🔐 Authentication

Overview

All requests to the Uniport API must be authenticated using your API key. Authentication is done using the Authorization header with the Bearer schema.

How to Authenticate

Include your API key in every request:

Authorization: Bearer YOUR_API_KEY

Example with curl:

curl https://api.uniportai.site/v1/chat/completions \
  -H "Authorization: Bearer sk-abc123xyz" \
  -H "Content-Type: application/json" \
  -d '{...}'

⚠️ Keep your key secure. Do not expose it in frontend apps or public repositories.


🧠 Models & Capabilities

Uniport provides access to a wide range of AI models, including open-source and commercial models. Supported categories include:

Type
Examples
Use Cases

Text (Chat)

GPT-4, Claude 3, LLaMA-3

Assistants, chatbots, coding

Text (Completion)

Mistral, Falcon

Creative writing, summarization

Image

Stable Diffusion, DALLE-3

Art generation, design mockups

Embeddings

OpenAI, Cohere, BGE

Search, classification, clustering

Audio

Whisper, Bark, XTTS

Transcription, TTS, voice agents

Each model includes metadata such as:

  • Cost per token

  • Average latency

  • Max context length

  • Supported input/output format

You can browse model details in the Playgroundarrow-up-right or via the /v1/models endpoint.


📈 Rate Limits

Default Limits

All accounts have default rate limits based on their plan:

Plan
RPM (Requests/Min)
TPS (Tokens/Sec)

Free

60 RPM

50 TPS

Pro

300 RPM

200 TPS

Enterprise

Custom

Custom

How Limits Work

  • Rate limits are per API key.

  • Exceeding limits returns: 429 Too Many Requests

Headers Returned:


Error Handling

Uniport returns standard HTTP status codes with informative error messages.

Common Errors

Code
Message
Reason

401

Unauthorized

Invalid or missing API key

403

Forbidden

API key disabled or lacks permissions

404

Not Found

Invalid endpoint or model ID

429

Too Many Requests

Rate limit exceeded

500

Internal Server Error

Server issue — try again later

400

Bad Request

Invalid input format or missing fields

Example Error Response:


📊 Usage & Billing

How Usage Is Tracked

Each request contributes to your billing:

  • Text: Billed per 1,000 tokens

  • Image: Billed per generation

  • Audio: Billed per second of audio processed

  • Embeddings: Billed per input unit (e.g., tokens or docs)

How to View Usage

  • Go to Billing → Usage Logs

  • See token counts, requests per model, and estimated cost

Billing Intervals

  • Billed monthly for Pro and Enterprise plans

  • Free tier resets every 30 days


✅ Pro Tips

  • Use streaming for chat models to reduce latency.

  • Cache embeddings for repeated queries.

  • Rotate models easily with minimal code changes thanks to Uniport's consistent API format.

  • Compare real-time cost/performance in the Model Comparator.


Would you like me to proceed with content for the AI Endpoints section next (e.g., /v1/chat/completions, /v1/embeddings, etc.)?

Last updated