---
title: "API Reference"
description: "AINative API reference for chat completions, embeddings, vector search, agent memory, file storage, and MCP hosting — compatible with the OpenAI SDK."
canonical: "https://docs.ainative.studio/docs/api/overview"
last-updated: "2026-09-23T01:51:08.820Z"
---

# API Reference

Source: https://docs.ainative.studio/docs/api/overview

> AINative API reference for chat completions, embeddings, vector search, agent memory, file storage, and MCP hosting — compatible with the OpenAI SDK.

**Version:** 2.1.0
**Last Updated:** January 6, 2026

Complete API documentation for all implemented features including Chat Completion API, Notifications, 2FA, Admin Monitoring, Email Services, and Third-Party Integrations.

## Base URLs

- **Production:** `https://api.ainative.studio`
- **Staging:** `https://staging-api.ainative.studio`
- **Development:** `http://localhost:8000`

## Quick Links

- [Chat Completion API](#chat-completion-api) **✨ NEW - Agentic Tool Calling**
- [Authentication](#authentication)
- [Notification System](/docs/guides/notifications)
- [Two-Factor Authentication](/docs/guides/two-factor-auth)
- [Notification Preferences](/docs/guides/notifications#notification-preferences)
- [Communication Settings](/docs/guides/notifications#communication-settings)
- [Admin Monitoring](/docs/guides/monitoring)
- [API Deprecation Policy](/docs/api/deprecations) — how version/endpoint deprecation is signaled

---

## Chat Completion API

**✨ NEW** - Build agentic applications with Llama and Anthropic models with full tool calling support.

### Endpoint

**POST** `/api/v1/chat/completions`

### Features

- 🤖 **Agentic Tool Calling**: Multi-iteration workflows with 5-10 max iterations
- 🔧 **30+ Built-in Tools**: ZeroDB operations, DevOps tools, Git, files, testing, and more
- 🚀 **Multi-Provider**: DigitalOcean (Llama 3.3/4), Cerebras, and Anthropic (Claude Sonnet/Opus)
- 📊 **Token Tracking**: Monitor usage across all iterations
- ⚡ **Fast & Reliable**: Production-ready with comprehensive error handling

### Quick Example

```bash
curl -X POST https://api.ainative.studio/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "provider": "digitalocean",
    "model": "Llama-3.3-70B-Instruct",
    "messages": [
      {"role": "user", "content": "What is the weather in NYC?"}
    ],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "get_weather",
          "description": "Get weather for a city",
          "parameters": {
            "type": "object",
            "properties": {
              "city": {"type": "string"}
            },
            "required": ["city"]
          }
        }
      }
    ],
    "max_iterations": 5
  }'
```

### Documentation

- **📖 Developer Guide**: [Chat Completions Guide](/docs/api/chat-completions)
  - Complete API reference with all parameters
  - 30+ tools documented with schemas
  - 4 working code examples
  - Best practices and advanced patterns

- **⚡ Quick Start**: [Quick Start](/docs/getting-started/quick-start)
  - 5-minute onboarding
  - Immediate working examples
  - Common patterns and use cases

### GitHub Issues

- Closes #623: Chat Endpoint with Agentic Tool Calling
- Closes #624: Tool Execution Loop for Providers

---

## Authentication

Include JWT token in Authorization header:

```bash
Authorization: Bearer <your-access-token>
```

### Login

**POST** `/api/v1/auth/login`

```bash
curl -X POST https://api.ainative.studio/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "password"}'
```

---

For complete documentation, see the full OpenAPI specification at `/docs/api/openapi.yaml`
