AAimyria

Developer guides / English / OpenAI-compatible API

API setup · Python

Connect an OpenAI-compatible API in Python.

This guide shows the two settings a compatible client needs: an API Base URL and a private API key. Use the exact model ID displayed in your account’s current model catalog.

1. Get the current connection details

Sign in only if the service is available in your region. Create your own API key in the dashboard and copy a model ID from the current model catalog. Model names and protocol support can change; do not reuse a model name from an old snippet.

Open the model catalog · Open the existing setup tutorial

2. Store the key outside your source code

Set the key in your shell or secret manager. Do not hard-code it in a repository, browser application, mobile app, shared notebook, screenshot, or client-side bundle.

macOS / Linux shell

export AIMYRIA_API_KEY="YOUR_OWN_API_KEY"
export AIMYRIA_MODEL="COPY_THE_EXACT_ID_FROM_THE_CATALOG"

PowerShell

$env:AIMYRIA_API_KEY = "YOUR_OWN_API_KEY"
$env:AIMYRIA_MODEL = "COPY_THE_EXACT_ID_FROM_THE_CATALOG"

3. Send a request with the OpenAI Python SDK

Install the SDK in your project, then run this example. Replace only the environment-variable values with your own key and a currently listed model ID.

Python

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AIMYRIA_API_KEY"],
    base_url="https://aimyria.com/v1",
)

response = client.chat.completions.create(
    model=os.environ["AIMYRIA_MODEL"],
    messages=[{"role": "user", "content": "Write a one-sentence greeting."}],
)

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

4. Or make the same request with cURL

Use a server-side terminal and keep the key out of shared shell history where possible.

curl https://aimyria.com/v1/chat/completions \
  -H "Authorization: Bearer $AIMYRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "'"$AIMYRIA_MODEL"'",
    "messages": [{"role": "user", "content": "Write a one-sentence greeting."}]
  }'

Troubleshooting

Use the key only within the permitted scope

Keep keys private and follow the service terms and upstream model policies. The published terms prohibit sharing access or redistributing the service without written authorization. Do not place the key in an application that exposes it to end users.

Common questions

Can I use any model ID with this endpoint?

No. Use an exact ID from the current catalog and confirm the protocol shown for that model.

Does OpenAI compatibility mean the service is operated by OpenAI?

No. It describes an API format. Aimyria is a separate service and is not the official operator of third-party models.

Can I create an account from any country or region?

No. Access is limited by the current supported-regions policy. Check the list before registration or purchase.

Check supported regionsMore developer guidesCreate an account