# Native APIs

Use native API formats and SDKs with your MIA API key.

## Choose an API

Open a model in [Explore](https://mia-ai-proxy-sit.ambr.io/explore) and check **API support**. Choose **View account rates**, then select an **API** in Quickstart when a selector is available. Use its model ID, URL, and parameters. If the API you need is not shown, [contact MIA](https://mia.ambr.io/contact) to confirm support.

Support is specific to the model and operation; a native API format does not imply support for every feature in a provider's API.

| API | SDK base URL | Authentication | Reference |
| --- | --- | --- | --- |
| OpenAI | `https://mia-ai-proxy-sit.ambr.io/v1` | `Authorization: Bearer` | [Chat Completions](https://mia-ai-proxy-sit.ambr.io/docs/api/chat-completions.md), [Responses](https://mia-ai-proxy-sit.ambr.io/docs/api/responses.md) |
| Anthropic | `https://mia-ai-proxy-sit.ambr.io` | `x-api-key` | [Messages](https://mia-ai-proxy-sit.ambr.io/docs/api/messages.md) |
| Google Gen AI | `https://mia-ai-proxy-sit.ambr.io`, API version `v1beta` | `x-goog-api-key` | [Google API](https://mia-ai-proxy-sit.ambr.io/docs/api/google.md) |

Use the MIA key as the SDK's API key. The Anthropic and Google SDKs add their API version paths; their base URL is the origin above. HTTP requests can also use `Authorization: Bearer YOUR_API_KEY`.

## OpenAI SDK

Install [`openai`](https://github.com/openai/openai-python). Set `MIA_MODEL` to a model that supports Responses.

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["MIA_API_KEY"],
    base_url="https://mia-ai-proxy-sit.ambr.io/v1",
    max_retries=0,
)
response = client.responses.create(
    model=os.environ["MIA_MODEL"], input="Hello", store=False,
)
print(response.output_text)
```

For Chat Completions, use the [Quickstart](https://mia-ai-proxy-sit.ambr.io/docs/quickstart.md#4-make-a-request).

## Anthropic SDK

Install [`anthropic`](https://github.com/anthropics/anthropic-sdk-python). Set `MIA_MODEL` to a model that supports Messages.

```python
import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ["MIA_API_KEY"],
    base_url="https://mia-ai-proxy-sit.ambr.io",
    max_retries=0,
)
response = client.messages.create(
    model=os.environ["MIA_MODEL"],
    max_tokens=256,
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.content)
```

## Google Gen AI SDK

Install [`google-genai`](https://github.com/googleapis/python-genai). Set `MIA_GOOGLE_MODEL` to the native model name shown in the model's Quickstart, without the `google/` catalog prefix.

```python
import os
from google import genai
from google.genai import types

client = genai.Client(
    api_key=os.environ["MIA_API_KEY"],
    vertexai=False,
    http_options=types.HttpOptions(
        base_url="https://mia-ai-proxy-sit.ambr.io",
        api_version="v1beta",
        retry_options=types.HttpRetryOptions(attempts=1),
    ),
)
response = client.models.generate_content(
    model=os.environ["MIA_GOOGLE_MODEL"], contents="Hello",
)
print(response.text)
```

These examples disable automatic retries. For streaming and error handling, see [Streaming](https://mia-ai-proxy-sit.ambr.io/docs/streaming.md) and [Errors and retries](https://mia-ai-proxy-sit.ambr.io/docs/errors.md).

## Other model APIs

Embeddings, images, audio, video, realtime, and other provider-specific operations use the examples in each model's Quickstart. Use its exact method, URL, request format, and SDK or WebSocket setup. [Image and video](https://mia-ai-proxy-sit.ambr.io/docs/media.md) explains how to resume asynchronous results.

## Tools and APIs

Tools use their native request format with the endpoint supplied for your integration, such as `https://mia-ai-proxy-sit.ambr.io/proxy/{name}/{path}`, and your MIA key as a Bearer token.

For an enabled tool, open [API Keys](https://mia-ai-proxy-sit.ambr.io/console/keys), expand the key, then choose **Agreed prices → Integration details** for its methods, endpoints, request requirements, and rates. To arrange access, choose a tool in [Explore](https://mia-ai-proxy-sit.ambr.io/explore?kind=tools) and follow its integration instructions. A tool listing alone does not establish access.

### Exa native search and research

For a provisioned Exa route, use `https://mia-ai-proxy-sit.ambr.io/proxy/exa` as the official Exa
SDK base URL and your MIA key as its API key. No `/v1` suffix is needed. Search,
Contents and Answer retain native parameters, rich results, citations and SSE.
[Tool details](https://mia-ai-proxy-sit.ambr.io/explore?kind=tools&capability=exa) show the
published Points rates; an explicit agreement on your key takes precedence.

Agent runs retain their native lifecycle at `/agent/runs`. Creation reserves
credit and freezes the price. Completion settles the final usage once; failed
or cancelled runs have zero customer fee. Reading the same run or replaying its
events adds no fee. Background settlement continues if your client disconnects.
The admission estimate does not change Exa's effort or budget parameters.

Use the same key and Account to read, stop, cancel, continue or delete a run.
Delete only after settlement; team-wide listing is unavailable on shared
metered routes. An uncertain creation must not be repeated automatically.
Monitors, batches and Websets are not included in this Points offering.
