> For the complete documentation index, see [llms.txt](https://docs.chainopera.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chainopera.ai/core/model-apis.md).

# Model APIs

<figure><img src="/files/RewgdUGEYxlcNTeY9C8U" alt=""><figcaption></figcaption></figure>

**Model APIs** provide your agents with direct access to a wide variety of **LLMs (Large Language Models)** and **multimodal models** through a **single unified API key**.

With Model APIs, developers no longer need to **register multiple providers** or **manage separate keys**—ChainOpera handles the integration for you.

***

#### **What Are Model APIs?**

**Model APIs** allow your agents to:

* Generate text, summarize content, or answer questions.
* Perform **reasoning and coding tasks** with instruction-following LLMs.
* Use **multimodal capabilities**, including vision and structured outputs.
* Access **multiple providers and models** from a unified interface.

**Example Supported Models:**

* **OpenAI** – GPT‑4o, GPT‑4o‑mini
* **Anthropic** – Claude 3, Claude 3.5 Sonnet
* **Groq / DeepSeek** – High‑performance inference models like DeepSeek‑R1 or Llama derivatives
* **Qwen (Alibaba / TensorOpera)** – Qwen 3 series, Qwen2.5‑32B / 72B‑Instruct
* **xAI** – Grok‑2 Vision multimodal model

***

#### **Accessing Model APIs**

1. Navigate to **“Model APIs”** from the sidebar.
2. Browse the available models with details including:
   * **Model Name & Version**
   * **Provider** (OpenAI, Anthropic, Groq, etc.)
   * **Capabilities** (Text, Code, Reasoning, Vision, Multilingual)
3. Identify the model best suited for your use case.

**Example UI View:**

* gpt-4o-mini – Cost-efficient small multimodal LLM by OpenAI
* claude-3.5-sonnet – High reasoning capability with 200K context
* deepseek-v3-0324 – Optimized for coding and reasoning tasks

***

#### **Using Model APIs in Agents**

You can integrate model APIs in **all creation modes**:

* **Prompt-based Agents**
  * Select a model in the prompt editor to generate responses.
* **Workflow Agents**
  * Add a **Model Node** to call the model at any step in the workflow.
* **Third-Party API Agents**
  * Use model APIs as part of backend orchestration or combine with external calls.
* **Agent Framework**
  * Directly call ChainOpera’s unified model endpoint from your code using the **provided API key**.

***

#### **API Key Management**

1. Click **“Get API Key”** at the top-right of the platform.
2. Use the unified key to access all supported models and endpoints.
3. Keep your key **secure** and **do not hardcode it** into public repositories.

**Example API Call (Python):**

```
import requests

url = "<https://api.chainopera.ai/v1/model>"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
payload = {
    "model": "gpt-4o-mini",
    "input": "Explain the difference between supervised and unsupervised learning."
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
```

***

#### **Best Practices**

* **Choose the right model** based on complexity and cost:
  * *Mini models* for lightweight tasks
  * *Full LLMs* for reasoning, analysis, or creative generation
  * *Multimodal models* if you need vision or structured outputs
* **Use workflows** to combine multiple model calls for step-by-step reasoning.
* **Monitor usage** to optimize performance and cost.
* **Keep your API key private** to prevent unauthorized access.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.chainopera.ai/core/model-apis.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
