API Documentation

High-level reference for integrating with Oryn.Pro. Authentication, endpoints, and examples below.

Authentication

Use your bearer token in the Authorization header:

curl -X POST https://api.oryn.pro/v1/complete \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"prompt":"Hello"}'

Rotate keys regularly. Never expose keys in client-side code.

Base URL

https://api.oryn.pro/v1

Endpoints

POST /complete

Generate a model completion from a prompt.

Request Body:
{
  "prompt": "Create an NFT marketplace on Ethereum",
  "maxTokens": 256,
  "temperature": 0.7
}

Response:
{
  "id": "cmpl_123",
  "object": "dapp_generation",
  "created": 1735242323,
  "model": "oryn-dapp-builder",
  "choices": [
    {"text": "Generated smart contract code...", "finishReason": "stop", "index": 0}
  ],
  "usage": {"promptTokens": 8, "completionTokens": 420, "totalTokens": 428}
}

POST /chat

Chat-style interaction with streaming support.

Request Body:
{
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "List 3 benefits of Rust."}
  ],
  "stream": true
}

GET /usage

Retrieve token and credit usage for the current key.

Response:
{
  "periodStart": "2025-08-01",
  "periodEnd": "2025-08-31",
  "requests": 421,
  "tokens": {"prompt": 120432, "completion": 342211, "total": 462643}
}

Error Format

{
  "error": {
    "type": "invalid_request",
    "message": "maxTokens must be <= 4096"
  }
}

Webhooks (Planned)

Webhook delivery for long-running jobs (fine-tuning, batch) is under development. Subscribe to updates in your dashboard.