Skip to main content

Step 1: Get Your API Key

Sign up at omniakey.com and generate your API key from the console.

Go to Console

Create your API Key

Step 2: Install the SDK

OmniaKey is fully compatible with the OpenAI SDK. Use the official OpenAI library for your language:
pip install openai

Step 3: Make Your First Request

Set the base URL to https://api.omniakey.com/v1 and use your OmniaKey API key:
from openai import OpenAI

client = OpenAI(
    api_key="your-omniakey-api-key",
    base_url="https://api.omniakey.com/v1"
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello! What can you do?"}
    ]
)

print(response.choices[0].message.content)

Response Example

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1709251200,
  "model": "gpt-4o",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! I can help you with a wide range of tasks..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 24,
    "completion_tokens": 35,
    "total_tokens": 59
  }
}

Step 4: Try Streaming

For real-time responses, enable streaming:
from openai import OpenAI

client = OpenAI(
    api_key="your-omniakey-api-key",
    base_url="https://api.omniakey.com/v1"
)

stream = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Write a short poem about AI."}],
    stream=True
)

for chunk in stream:
    if chunk.choices[0].delta.content is not None:
        print(chunk.choices[0].delta.content, end="")

Next Steps