---
title: "Using API for Working With AI Agents and Models | Hostman Docs"
description: "API types for managing AI agents and AI models. Key differences and choosing the API type for your tasks."
---

> For the complete documentation index for AI agents, see [llms.txt](https://hostman.com/llms.txt).

We support three types of API for working with AI agents and models:

-   [OpenAI-compatible API](https://hostman.com/docs/ai-agents/api-usage/openai-compatible-api/): suitable for integration with external libraries and UIs, using the standard request structure.
    
-   [Native API](https://hostman.com/docs/ai-agents/api-usage/native-api/): simpler and easier to use, especially when a quick result is needed without external dependencies.
    
-   [AI Gateway](https://hostman.com/docs/ai-agents/ai-gateway/): for working directly with models without using AI agents.

## Key Differences

| **Feature** | **OpenAI compatible API** | **Native API** | **AI Gateway** |
| --- | --- | --- | --- |
| Object of operation | An agent | An agent | A model |
| Request format | `messages[]` | `message` + `parentMessageId` | `messages[]`, `responses` |
| Message history | Sent with the request | Stored | Sent with the request |
| RAG / MCP | Supported | Supported | Not supported |
| Model settings | Via the agent's dashboard | Via request parameters | Sent with each request |
| Model selection | Limited to the agent's model | Limited to the agent's model | Any available model |
| Streaming responses | Supported | Not supported | Supported |

## Which API to Choose

**Use the OpenAI-compatible API if you:**

-   Want to integrate the agent with external libraries (e.g., LangChain, Open WebUI)
-   Already use OpenAI and want to simply replace the URL
-   Need usage statistics (tokens, model)
-   Require streaming responses
-   Plan to use multimodal messages

**Use the Native API if you:**

-   Need built-in message history without explicitly passing context
-   Are building a simple app with minimal external dependencies
-   Want responses in a simple format
-   Need fast and lightweight integration, for example, for an MVP

**Use AI Gateway if you:**

-   Need to work directly with models without agent logic
-   Are building your own logic (e.g., RAG or request routing)
-   Need access to multiple models through a single API
-   Are using the OpenAI SDK and want to switch between models without changing your code
