Softelv AI Logo Softelv AI
Developer Quickstart Guide

Softelv AI API Documentation
Drop-In OpenAI Compatibility

All endpoints conform 100% to standard Chat Completions and Image Generation specifications. Simply switch your base_url and pass your API key to get started immediately.

Core Connection Settings

Standard bearer token authentication over encrypted HTTPS.

Base Endpoint

Base URL

The global base path for all REST and streaming completions:

https://softelv.ai/v1
Security & Auth

Authentication

Sent in the standard HTTP request header:

Authorization: Bearer sk-nashmi-...

Quick Integration Examples

Use the official client libraries without changing your application code structure.

1. Python (Official OpenAI SDK)

Install: pip install openai

from openai import OpenAI

client = OpenAI(
    base_url="https://softelv.ai/v1",
    api_key="sk-nashmi-your-api-key"
)

stream = client.chat.completions.create(
    model="llama-3.3-70b",
    messages=[
        {"role": "system", "content": "You are an expert software engineer assistant."},
        {"role": "user", "content": "Explain the architectural differences between REST and gRPC."}
    ],
    stream=True
)

for chunk in stream:
    content = chunk.choices[0].delta.content or ""
    print(content, end="", flush=True)

2. Node.js (TypeScript / JavaScript)

Install: npm install openai

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://softelv.ai/v1",
  apiKey: "sk-nashmi-your-api-key"
});

async function run() {
  const completion = await client.chat.completions.create({
    model: "deepseek-r1",
    messages: [{ role: "user", content: "Analyze this algorithmic time complexity problem..." }]
  });

  console.log(completion.choices[0].message.content);
}

run();

3. Direct cURL Request

Standard HTTP POST request from any CLI or backend environment.

curl -X POST https://softelv.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-nashmi-your-api-key" \
  -d '{
    "model": "llama-3.3-70b",
    "messages": [{"role": "user", "content": "Hello Softelv AI"}],
    "temperature": 0.7
  }'

Generative Image Synthesis (FLUX.1 Schnell)

Generate ultra-high fidelity images in under 2 seconds with automatic bilingual prompt translation.

curl -X POST https://softelv.ai/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-nashmi-your-api-key" \
  -d '{
    "prompt": "Cinematic wide photography of ancient Petra illuminated by warm lantern light during twilight",
    "model": "flux-1-schnell",
    "size": "1024x1024"
  }'

HTTP Response & Error Codes

Softelv AI conforms to standard HTTP response patterns for predictable handling.

Status Code Description Recommended Action
200 OK Request completed successfully. Consume response JSON payload or SSE stream chunks.
401 Unauthorized API key is missing or revoked. Verify the Authorization: Bearer sk-... header.
404 Not Found Requested model ID is invalid or endpoint does not exist. Review active models in the Model Catalog.
429 Rate Limit Concurrency or requests per minute limit reached. Implement exponential backoff or upgrade to the Pro plan.
500 Internal Error Transient upstream inference node issue. Retry request with backoff; failover occurs automatically.