For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DocumentationAPI ReferenceSelf HostModel CardsClient LibrariesIntegrationsDeveloper ToolsChangelog
DocumentationAPI ReferenceSelf HostModel CardsClient LibrariesIntegrationsDeveloper ToolsChangelog
  • Getting Started
    • Introduction
    • Models
    • Authentication
  • Text to Speech (Lightning)
    • Quickstart
    • Overview
    • Sync & Async
    • Streaming
    • Pronunciation Dictionaries
    • Voices & Languages
    • HTTP vs Streaming vs WebSockets
  • Speech to Text (Pulse)
    • Quickstart
    • Overview
  • LLM (Electron)
    • Quickstart
    • Overview
    • Chat Completions
    • Streaming
    • Tool / Function Calling
    • Prefix Caching
    • Supported Parameters
    • Migrate from OpenAI
    • Best Practices
  • Cookbooks
    • Speech to Text
    • Text to Speech
    • Voice Agent (Electron + Pulse + Lightning)
  • Voice Cloning
    • Instant Clone (UI)
    • Instant Clone (API)
    • Instant Clone (Python SDK)
    • Delete Cloned Voice
  • Best Practices
    • Voice Cloning Best Practices
    • TTS Best Practices
  • Troubleshooting
    • Error reference
LogoLogo
Voice AgentsModels
Voice AgentsModels
On this page
  • Step 1: Get Your API Key
  • Step 2: Make Your First Call
  • Step 3: Use the OpenAI SDK
  • What’s next
LLM (Electron)

Quickstart

||View as Markdown|
Was this page helpful?
Previous

Evaluation Walkthrough

Next

Overview

Built with

Electron is OpenAI-compatible. If you can call the OpenAI Chat Completions API, you can call Electron — change the base URL and the API key, and your existing code works.

Step 1: Get Your API Key

In the Smallest AI Console, go to Settings → API Keys and click Create API Key. Copy it and export:

$export SMALLEST_API_KEY="your-api-key-here"
New to Smallest AI? Sign up here first.

Step 2: Make Your First Call

Paste this cURL — no install required:

$curl -X POST "https://api.smallest.ai/waves/v1/chat/completions" \
> -H "Authorization: Bearer $SMALLEST_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "model": "electron",
> "messages": [
> {"role": "user", "content": "Write one sentence about why the sky is blue."}
> ]
> }'

You’ll get back the standard OpenAI chat-completion shape:

1{
2 "id": "chatcmpl-...",
3 "object": "chat.completion",
4 "model": "electron",
5 "choices": [
6 {
7 "index": 0,
8 "message": {
9 "role": "assistant",
10 "content": "The sky appears blue because shorter blue wavelengths of sunlight scatter more than longer wavelengths when they pass through Earth's atmosphere."
11 },
12 "finish_reason": "stop"
13 }
14 ],
15 "usage": {
16 "prompt_tokens": 17,
17 "completion_tokens": 24,
18 "total_tokens": 41
19 }
20}

Step 3: Use the OpenAI SDK

Because Electron speaks the OpenAI wire format, you can use the official OpenAI SDKs verbatim — just override base_url (or baseURL) and api_key.

Install the SDK if you don’t already have it:

$pip install openai # Python
$# or
$npm install openai # Node.js
1import os
2from openai import OpenAI
3
4client = OpenAI(
5 base_url="https://api.smallest.ai/waves/v1",
6 api_key=os.environ["SMALLEST_API_KEY"],
7)
8
9response = client.chat.completions.create(
10 model="electron",
11 messages=[
12 {"role": "user", "content": "Write one sentence about why the sky is blue."}
13 ],
14)
15
16print(response.choices[0].message.content)

What’s next

Streaming

Get tokens as they’re generated. Set stream: true for SSE.

Tool Calling

Use Electron for agents — it returns OpenAI-style tool_calls and is trained to handle voice-agent flows.

Prefix Caching

Cached input tokens are billed at 75% off. Structure your prompts to hit the cache.

Migrate from OpenAI

Side-by-side diff: what changes when you switch from api.openai.com.