Let's talk

Seamless Integration

OpenAI Compatible API for Agents

Turn your complex agentic workflows into simple API endpoints. Use standard /v1/chat/completions calls to interact with your agents.

By Divyaprakash JhaUpdated 4 min readTopic: Agentic AI

Photo for OpenAI Compatible API for Agents

What is an OpenAI Compatible API for Agents?

An OpenAI-compatible API allows you to call an AI agent or a complex workflow using the standard /v1/chat/completions endpoint. This means you can use any existing OpenAI client or SDK to interact with your agents as if they were simple chat models.

  • It allows you to call an agent or a workflow using the standard /v1/chat/completions endpoint.
  • You can use any existing OpenAI client to communicate with your agents.
  • Instead of a raw model, you set the model parameter to an agent role or a specific workflow.
  • This turns complex, multi-step agentic processes into a single, predictable API call.

Why Use Standard APIs for Agentic AI?

For builders and business owners, the goal is to move from experimental scripts to reliable software. Using standard protocols like an OpenAI-compatible API provides several strategic advantages:

  • Avoids vendor lock-in: By using open, standard protocols, you ensure your integration isn't tied to a single proprietary platform.
  • Simplifies integration: You can plug your agents into existing software stacks and LLM orchestration tools without rewriting your entire codebase.
  • Abstraction of complexity: It allows developers to treat autonomous agents as if they were simple chat models, even though complex agentic architecture is running behind the scenes.

Imagine a small retail business in Mumbai using an automated agent to manage inventory. Instead of building a custom, complex interface to talk to the inventory agent, the owner can use their existing customer service dashboard—which already knows how to talk to OpenAI—to simply "chat" with the inventory agent to check stock levels or reorder supplies.

How Shiva Agents Implements Agent APIs

Shiva Agents is designed to be part of your existing ecosystem rather than a walled garden. We focus on interoperability so that your agents can work alongside other tools and protocols.

  • Plug-and-play design: Our platform is built to integrate into what you already use.
  • Workflow support: You can call a specific, predefined workflow via the /v1/chat/completions endpoint just as easily as you would a single model.
  • Open protocols: We support standard OpenAI-compatible calls, the Model Context Protocol (MCP), and A2A (Agent-to-Agent) for full interoperability.

By supporting MCP, Shiva Agents allows your agents and workflows to be available as tools to any Model Context Protocol client, making them useful components in a larger AI ecosystem.

The Difference: Model API vs. Agent API

It is crucial to understand that an agent is not just a "smarter" model; it is a different type of software execution. While a model API provides a response to a prompt, an agent API executes a goal-oriented process.

Feature Model API Agent API
Primary Output A single text completion or response. A completed goal or a series of steps.
Internal Logic Directly predicts the next token. Runs a loop: Plan, Act, Observe, and Verify.
Tool Usage Requires the user to handle tool results. The agent calls tools, reads results, and decides the next step autonomously.
Complexity Low; one-shot interaction. High; manages memory, reasoning, and error correction.

In a standard model API, if you ask "Reconcile these invoices," the model might tell you *how* to do it. In an agent API, the agent actually performs the task: it reads the files, queries the ledger, compares the numbers, and only returns to you once the job is done or it needs your help.

Moving from Notebooks to Production

Most AI agent demos are simple, single loops running in a Jupyter notebook. While great for testing, these are not suitable for real business operations. Production-grade agents require durability and the ability to handle real-world interruptions.

Shiva Agents provides an API designed for the "second world" of AI—the world where agents run as part of an ongoing company operation. Our architecture addresses the specific needs of professional deployment:

  • Durability: Our engine provides a checkpoint after every step. If a server restarts, the agent can resume exactly where it left off.
  • Asynchronous workflows: Production tasks often take time. Our API supports patterns where an agent can pause for days to wait for a human to approve a refund or a contract before continuing.
  • Resource Management: We implement token-based execution, dead-path elimination, and bounded cycles to ensure your agent doesn't run into infinite loops and drain your budget.

Whether you are building a simple automation or a complex multi-agent system, moving from a script to a durable API is the key to making AI work for your business day-in and day-out.

Frequently Asked Questions

Can I use my existing OpenAI SDK with Shiva Agents?
Yes. Because Shiva Agents provides an OpenAI-compatible API, you can use any standard OpenAI client to interact with your agents.
What happens when I call an agent via the API?
The API triggers the agent's internal loop, where it plans, uses tools, and verifies results until the task is complete or requires human intervention.
Is the API compatible with workflows?
Yes, you can call a specific workflow via the /v1/chat/completions endpoint just as you would a model.
How does this differ from a standard LLM API?
A standard LLM API returns a response to a prompt; an agent API executes a goal-oriented process that may involve multiple tool calls and reasoning steps.
Does the API support human-in-the-loop?
Yes, the architecture allows for pauses where a human can approve or deny actions before the API completes the task.
Yellow robotic arm operating inside a glass enclosure with a monitor above.
Photo: Robot arm works on a small component in a lab setting by Shixart1985, CC BY 2.0

Questions people ask

Can I use my existing OpenAI SDK with Shiva Agents?

Yes. Because Shiva Agents provides an OpenAI-compatible API, you can use any standard OpenAI client to interact with your agents.

What happens when I call an agent via the API?

The API triggers the agent's internal loop, where it plans, uses tools, and verifies results until the task is complete or requires human intervention.

Is the API compatible with workflows?

Yes, you can call a specific workflow via the /v1/chat/completions endpoint just as you would a model.

How does this differ from a standard LLM API?

A standard LLM API returns a response to a prompt; an agent API executes a goal-oriented process that may involve multiple tool calls and reasoning steps.

Does the API support human-in-the-loop?

Yes, the architecture allows for pauses where a human can approve or deny actions before the API completes the task.