Let's talk

Seamless Integration

OpenAI-compatible API for AI Agents

Connect your existing software to autonomous agents using standard protocols. Use any OpenAI client to trigger complex agentic workflows.

By Divyaprakash JhaUpdated 5 min readTopic: Agentic AI

Photo for OpenAI-compatible API for AI Agents

What is an OpenAI-compatible API?

An OpenAI-compatible API allows you to treat complex AI agents or multi-step workflows as if they were standard Large Language Models (LLMs). By using the standard /v1/chat/completions endpoint, you can integrate autonomous agents into your existing software without changing your core code.

In a traditional setup, you send a prompt to a model and get a text response. With an OpenAI-compatible API for agents, you send a prompt to an agent, and the agent performs a series of actions—like checking a database or sending an email—before returning a final response in the standard chat format.

  • Standardized Access: Call an AI agent or a complex workflow using the standard /v1/chat/completions endpoint.
  • Agents as Models: You can treat an entire agentic process as a model by simply setting the model parameter to an agent role or a specific workflow.
  • Zero Code Changes: Any existing OpenAI client, SDK, or library can communicate with your custom agents immediately.

Why use a compatible API for agents?

For builders and business owners, the goal is to move from simple chatbots to agents that actually "do work." Using a compatible API removes the friction of this transition.

Instead of rewriting your entire application to support a new, proprietary agent framework, you simply swap the model name. This provides several strategic advantages:

  • Avoid Vendor Lock-in: By using open standards, you aren't trapped by a single provider's unique interface.
  • Instant Integration: Plug agents into your current tech stack instantly. If your app already knows how to talk to OpenAI, it already knows how to talk to your agents.
  • Bridge the Gap: Move beyond simple "Q&A" bots to autonomous agents that can execute multi-step goals, such as a logistics agent that reconciles shipping manifests against warehouse receipts.

How it works in practice

The magic happens because the API hides the complexity of the agentic loop. When you call the API, you aren't just asking for a prediction; you are triggering a sophisticated agentic architecture.

The API initiates a loop that follows these essential stages:

  1. Plan: The agent decides the next steps required to reach the goal.
  2. Act: The agent calls a tool, such as a database query, an API call, or a file write.
  3. Observe and Verify: The agent reads the tool's result (e.g., "Did the invoice total match?") and checks if the task is complete.
  4. Remember: The agent records what happened so it can use that information in the next step.
  5. Repeat or Stop: The loop continues until the goal is met or a human is required.

The end user or the calling application only sees the final result in a standard chat completion format, making it incredibly easy for developers to implement.

Agents vs. Standard LLMs

It is vital for business owners to understand the difference between a standard chatbot and an agent. While they may look similar in a chat window, their underlying logic is fundamentally different.

Feature Standard LLM / Chatbot AI Agent (via API)
Core Function Provides a single reply to a prompt. Drives a process to reach a goal.
Decision Making Predicts the next word in a sequence. Decides the next action or tool to use.
Workflow One-and-done interaction. Multi-step loops (e.g., managing bookings).
Predictability High (for single turns). Variable (requires guardrails).

An example for a small business: A chatbot can answer "What are your clinic hours?" instantly. An agent can "Fill next week's clinic slots" by checking cancellations, messaging waitlisted patients, and rebooking them automatically.

Built for Production Workflows

In a laboratory setting, an agent might run in a single notebook. In a business setting, agents must be reliable, durable, and safe. Shiva Agents is designed for the "second world"—the world of real-world business operations.

To be production-ready, our API-driven agents include:

  • Durable Workflows: Our engine supports workflows that survive server restarts. If a process is interrupted, it doesn't start from scratch.
  • Checkpoints: We save a checkpoint after every single step. This allows the agent to resume exactly where it left off.
  • Human-in-the-Loop: For risky or critical actions—like approving a large refund or changing a bank account detail—the agent can pause and wait for human approval.
  • Auditability: Every action is recorded in a hash-chained audit log, ensuring a permanent, unchangeable record of what the agent did.

Beyond the API: Open Protocols

We believe agents should not live in a walled garden. While the OpenAI-compatible API is the easiest way to get started, we provide several other ways for agents to interact with the world through open protocols.

Model Context Protocol (MCP)

You can expose your agents and workflows as tools to any client using the Model Context Protocol (MCP). By running an MCP server, your agent can become a specialized skill available to other AI models and applications.

Agent-to-Agent (A2A) Communication

Through A2A protocols, agents can discover and delegate tasks to one another. Using an A2A agent card, one agent can "hire" another agent to handle a specific sub-task, creating a collaborative team of specialists.

Real-time Automation

Combine our APIs with webhooks and event streams to create highly responsive automation. Whether it is a schedule-based "heartbeat" that wakes an agent up every morning or a webhook that triggers an agent when a new invoice arrives, the possibilities for real-time operation are vast.

Frequently Asked Questions

Can I use my existing OpenAI SDK with Shiva Agents?
Yes. Because we provide an OpenAI-compatible API, you can use your existing OpenAI client to call agents and workflows via the /v1/chat/completions endpoint.
What is the difference between a chatbot and an agent via API?
A chatbot typically provides a single response to a prompt, whereas an agent uses the API to trigger a loop of planning, tool-calling, and verifying until a goal is met.
How do agents handle long-running tasks?
Our architecture uses durable workflows with checkpoints after every step, allowing agents to pause for human approval or survive a system restart.
Can agents talk to each other using this API?
Yes, through A2A (Agent2Agent) protocols, agents can discover and delegate tasks to one another.
Do I need to rewrite my code to use an agent instead of an LLM?
No. You simply change the model name to the agent or workflow role you wish to trigger, and the rest of your standard OpenAI implementation remains the same.
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 we provide an OpenAI-compatible API, you can use your existing OpenAI client to call agents and workflows via the /v1/chat/completions endpoint.

What is the difference between a chatbot and an agent via API?

A chatbot typically provides a single response to a prompt, whereas an agent uses the API to trigger a loop of planning, tool-calling, and verifying until a goal is met.

How do agents handle long-running tasks?

Our architecture uses durable workflows with checkpoints after every step, allowing agents to pause for human approval or survive a system restart.

Can agents talk to each other using this API?

Yes, through A2A (Agent2Agent) protocols, agents can discover and delegate tasks to one another.

Do I need to rewrite my code to use an agent instead of an LLM?

No. You simply change the model name to the agent or workflow role you wish to trigger, and the rest of your standard OpenAI implementation remains the same.