---
title: "Provider: Tera"
subtitle: "Call Tera models through Respan Gateway with unified logs, cost, and latency."
---

<Note>This page is for **Respan LLM Gateway** users.</Note>

Use Respan Gateway to call Tera models (`tera/moonshotai/Kimi-K3`) while keeping unified observability (logs, cost, latency, reliability) in Respan.

Paste this into your coding agent:

```text
Help me set up the Respan gateway to call Tera models.
Follow https://www.respan.ai/docs/documentation/agent-setup.md
```

## Quick setup

<Steps>
  <Step title="Get a Respan API key">
    [Sign up](https://platform.respan.ai) and create a key on the [API keys page](https://platform.respan.ai/platform/gateway/api-keys).
  </Step>
  <Step title="Add credits (recommended)">
    [Top up credits](https://platform.respan.ai/platform/gateway/credits) to pay through Respan. No Tera key required, Respan handles provider auth and billing.

    Prefer to route through your own Tera account? See [Use your own Tera key](#use-your-own-tera-key-byok).
  </Step>
</Steps>

## Send your first request

Pick the integration that matches your stack. The base URL is `https://api.respan.ai/api` and the only key needed is your `RESPAN_API_KEY`.

<Tabs>
  <Tab title="OpenAI SDK">
    Tera is OpenAI-compatible. Point the OpenAI SDK at the Respan gateway and call any Tera model with the `tera/` prefix.

    <Tabs>
<Tab title={"Python"}>

    ```python
    from openai import OpenAI

    client = OpenAI(
        api_key="YOUR_RESPAN_API_KEY",
        base_url="https://api.respan.ai/api",
    )

    response = client.chat.completions.create(
        model="tera/moonshotai/Kimi-K3",
        messages=[{"role": "user", "content": "Hello, Tera!"}],
    )
    print(response.choices[0].message.content)
    ```

</Tab>
<Tab title={"TypeScript"}>

    ```typescript
    import OpenAI from "openai";

    const client = new OpenAI({
      apiKey: process.env.RESPAN_API_KEY,
      baseURL: "https://api.respan.ai/api",
    });

    const response = await client.chat.completions.create({
      model: "tera/moonshotai/Kimi-K3",
      messages: [{ role: "user", content: "Hello, Tera!" }],
    });
    console.log(response.choices[0].message.content);
    ```

</Tab>
</Tabs>
  </Tab>

  <Tab title="Respan API">
    Call the Respan REST API directly from any language.

    <Tabs>
<Tab title={"Python"}>

    ```python
    import requests

    response = requests.post(
        "https://api.respan.ai/api/chat/completions",
        headers={
            "Authorization": "Bearer YOUR_RESPAN_API_KEY",
            "Content-Type": "application/json",
        },
        json={
            "model": "tera/moonshotai/Kimi-K3",
            "messages": [{"role": "user", "content": "Hello, Tera!"}],
        },
    )
    print(response.json()["choices"][0]["message"]["content"])
    ```

</Tab>
<Tab title={"TypeScript"}>

    ```typescript
    const response = await fetch("https://api.respan.ai/api/chat/completions", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.RESPAN_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        model: "tera/moonshotai/Kimi-K3",
        messages: [{ role: "user", content: "Hello, Tera!" }],
      }),
    });

    const data = await response.json();
    console.log(data.choices[0].message.content);
    ```

</Tab>
</Tabs>
  </Tab>
</Tabs>

## More integrations

Tera models work with every Respan gateway integration:

- [OpenAI SDK](/docs/integrations/openai-sdk)
- [OpenAI Agents SDK](/docs/integrations/openai-agents-sdk)
- [LangChain](/docs/integrations/langchain)
- [LangGraph](/docs/integrations/langgraph)
- [LlamaIndex](/docs/integrations/llama-index)
- [Pydantic AI](/docs/integrations/pydantic-ai)
- [Respan native (OTel)](/docs/documentation/features/gateway/gateway-quickstart)

## Switch models

Change the `model` parameter to call any supported model through the same client. Use the `tera/` prefix to disambiguate when routing across providers. Browse the full list on the [Models page](https://platform.respan.ai/platform/models).

```python
client.chat.completions.create(model="tera/moonshotai/Kimi-K3", messages=messages)
client.chat.completions.create(model="openai/gpt-6-sol", messages=messages)
client.chat.completions.create(model="anthropic/claude-opus-5-5", messages=messages)
```

## Use your own Tera key (BYOK)

Credits are the default path. If you'd rather bill Tera directly, attach your own provider key.

<Tabs>
  <Tab title="Global (UI)">
    <Steps>
      <Step title="Open Providers">
        Go to the [Providers page](https://platform.respan.ai/platform/gateway/api-keys?providers=1).
      </Step>
      <Step title="Add Tera">
        Select **Tera** and paste your `tera.api_key`.
      </Step>
      <Step title="Load balancing (Optional)">
        Add multiple credential sets and use **Load balancing weight** to distribute traffic across them.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Per-request (Code)">
    Pass `customer_credentials` on each [Gateway request](/docs/apis/gateway/create-chat-completion). Useful when serving end-user keys.

    ```json
    {
      "customer_credentials": {
        "tera": {
          "api_key": "YOUR_TERA_API_KEY"
        }
      }
    }
    ```
  </Tab>
</Tabs>

### Override credentials per model (Optional)

Use [`credential_override`](/docs/documentation/admin/llm_provider_keys#per-model-credential-override) when one model on a request should use a different Tera key than the default.

```json
{
  "customer_credentials": {
    "tera": { "api_key": "YOUR_TERA_API_KEY" }
  },
  "credential_override": {
    "tera/moonshotai/Kimi-K3": { "api_key": "ANOTHER_TERA_API_KEY" }
  }
}
```

## Log without proxying (Optional)

Already calling Tera directly? Send logs to Respan asynchronously to track cost, latency, and performance for those external calls.

```python
import requests

requests.post(
    "https://api.respan.ai/api/request-logs/create/",
    headers={
        "Authorization": "Bearer YOUR_RESPAN_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "model": "tera/moonshotai/Kimi-K3",
        "prompt_messages": [{"role": "user", "content": "Hello, how are you?"}],
        "completion_message": {"role": "assistant", "content": "Hello from Tera through Respan."},
        "cost": 0.001,
        "generation_time": 1.2,
        "customer_params": {"customer_identifier": "user_123"},
    },
)
```

See the [logging guide](/docs/apis/spans/create-span) for the full setup.
