Language Models API

Build smarter applications using AI with our powerful and secure API.

Get started quickly with our developer-friendly endpoints and robust security features.

Start Building

Getting Started

API Key Authentication

  • 1. Get your API key from the Account Settings
  • 2. Set the Authorization header: Bearer YOUR_API_KEY
  • 3. Make your first request to /api/v1/complete
curl -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"Once upon a time","max_tokens":50}' \
  https://api.llm.org/v1/complete
                        

Available Endpoints

Text Generation

Generate text completions using our large language models

POST /api/v1/complete
  • JSON API
  • Bearer Auth

Embedding Generation

Create vector embeddings of text for similarity searches

POST /api/v1/embed
  • JSON API
  • Bearer Auth

Batch Processing

Process multiple requests in a single batch for efficiency

POST /api/v1/batch
  • JSON API
  • Bearer Auth

Request Examples

Sample Request

POST /api/v1/complete
{"Authorization": "Bearer your_api_key", "Content-Type": "application/json"}
{"prompt": "Explain quantum computing in simple terms", "max_tokens": 100, "temperature": 0.7}
  • Prompt: User query or instruction
  • max_tokens: Maximum tokens in response
  • Temperature: Response creativity (0.1-2.0)

Sample Response

Status: 200 OK
{"text": "Quantum computing uses qubits that can exist in multiple states simultaneously...", "usage": {"prompt_tokens": 7, "completion_tokens": 63}}
Headers