API versioning

The Mira API uses URL-based versioning to ensure backward compatibility and smooth migration between versions. The current stable version is v1.

Current version

Base URL (v1)
https://api.vmira.ai/v1

All endpoints include the version in the URL path. For example:

POST/v1/chat/completionsChat completions
GET/api/v1/modelsModels list

How versioning works

The API version is specified directly in the URL path (e.g., /v1/). This means different API versions can coexist simultaneously, allowing gradual migration.

  • URL-basedThe version is part of the URL: /v1/chat/completions. When v2 is released, the URL will be /v2/chat/completions.
  • No implicit versionsRequests without a version in the URL are not supported. Always specify the version explicitly.
  • Default versionCurrently the only available version is v1. When new versions are released, v1 will continue to work.

Backward compatibility policy

Mira follows a strict backward compatibility policy within a major version:

  • Non-breaking changesAdding new fields to responses, new optional request parameters, and new endpoints — these changes do not require client code updates.
  • Breaking changesRemoving fields, changing types, renaming parameters, and behavior changes — these are only possible in a new major version (v2).
Your code that works with v1 will continue to work without changes, even if we add new fields to responses or new optional parameters.

Deprecation notices

If an API version is scheduled for removal, Mira provides at least 12 months for migration:

  • AnnouncementA deprecation notice is published in the documentation, blog, and sent via email to all users with active keys.
  • Migration periodThe old version continues to work for at least 12 months after the announcement. During this period you can update your code.
  • Warning headersResponses from a deprecated version will include a Deprecation header with the removal date.
  • RemovalAfter the migration period ends, the old version returns a 410 Gone error.
Deprecation header
HTTP/1.1 200 OK
Deprecation: Sun, 01 Jan 2028 00:00:00 GMT
Sunset: Sun, 01 Jan 2028 00:00:00 GMT
Link: <https://docs.vmira.ai/migration/v1-to-v2>; rel="deprecation"

Migration from OpenAI

The Mira API is fully compatible with the OpenAI format. If you already use the OpenAI API or SDK, migration requires minimal effort — just change the base URL and API key.

Using the OpenAI SDK

Python (OpenAI SDK)
from openai import OpenAI

# Before (OpenAI)
# client = OpenAI(api_key="sk-...")

# After (Mira) — just change base_url and api_key
client = OpenAI(
    base_url="https://api.vmira.ai/v1",
    api_key="sk-mira-your-key-here",
)

response = client.chat.completions.create(
    model="mira",  # Use a Mira model name
    messages=[{"role": "user", "content": "Hello, Mira!"}],
)

print(response.choices[0].message.content)
JavaScript (OpenAI SDK)
import OpenAI from "openai";

// Before (OpenAI)
// const client = new OpenAI({ apiKey: "sk-..." });

// After (Mira) — just change baseURL and apiKey
const client = new OpenAI({
  baseURL: "https://api.vmira.ai/v1",
  apiKey: "sk-mira-your-key-here",
});

const response = await client.chat.completions.create({
  model: "mira",  // Use a Mira model name
  messages: [{ role: "user", content: "Hello, Mira!" }],
});

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

Migration changes

WhatOpenAIMira
Base URLhttps://api.openai.com/v1https://api.vmira.ai/v1
Key formatsk-...sk-mira-...
Modelsgpt-4o, gpt-4o-minimira, mira-pro, mira-max
Request formatIdenticalIdentical
Response formatIdenticalIdentical

Migration via environment variables

For quick migration, you can use environment variables without changing application code:

Environment variables
# Replace in your .env file
OPENAI_API_KEY=sk-mira-your-key-here
OPENAI_BASE_URL=https://api.vmira.ai/v1
The OpenAI SDK automatically reads OPENAI_API_KEY and OPENAI_BASE_URL from the environment. By setting these variables, you can switch to Mira without changing code.

Next steps