API Reference

Complete reference for the RunAs AI API with interactive examples

Endpoints
Browse all available API endpoints
POST
Generate Text

/v1/generate

POST
Chat Completions

/v1/chat/completions

GET
List Models

/v1/models

POST
Create Embeddings

/v1/embeddings

GET
Usage Statistics

/v1/usage

POST
Generate Text
Generate text using AI models with customizable parameters

Endpoint

POST https://api.runas.ai/v1/generate

Headers

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Request Body

{
  "prompt": "string",
  "model": "gpt-4",
  "max_tokens": 500,
  "temperature": 0.7,
  "top_p": 1.0,
  "frequency_penalty": 0.0,
  "presence_penalty": 0.0
}