---
title: "Reference — AVCodex Docs"
description: "Reference — AVCodex documentation for AV integrators, programmers, and ops teams."
lang: en
json-ld:
---

[](/)

Solutions

[Pricing](/pricing)[The Signal](/blog)[Resources](/resources)

Learn

[Free AI Assessment](/scorecard)[Get Started →](/pricing)

[Documentation Home](/docs)

Guides 

Custom Actions 

Pro Actions 

API 

-   [Quickstart](/docs/api/quickstart)
-   [Authentication](/docs/api/authentication)
-   [Reference](/docs/api/reference)
-   [Chat Transcript](/docs/api/chat-transcript)
-   [Streaming](/docs/api/streaming)
-   [Org Export API](/docs/api/org-export-api)

Builder API 

Agentic Commerce (ACP) 

Integrations 

[Docs](/docs)/ API / API 

# Reference

Last updated · MAR 2026 · [Read as Markdown](/docs/api/reference.md)

# API Reference

Complete reference for the AVCodex Chat Completions endpoint.

* * *

## [Endpoint# ](#endpoint)

code 

```
POST https://app.avcodex.com/api/v1/chat/completions
```

## [Request# ](#request)

### [Headers# ](#headers)

Header

Required

Description

`Authorization`

Yes

`Bearer YOUR_API_KEY`.

`Content-Type`

Yes

`application/json`.

`X-Chat-Session-ID`

No

Alternative session ID.

`X-Correlation-ID`

No

Request tracking ID.

### [Body# ](#body)

typescript 

```
{
  model: string;          // Your agent's appNameId (e.g., "myagent-123")
  messages: Array<{
    role: "user" | "assistant" | "system";
    content: string;
  }>;
  stream?: boolean;       // Default: false
  chatSessionId?: string; // Continue conversation
}
```

### [Parameters# ](#parameters)

-   **model:** your AVCodex agent's `appNameId` (format: `agentname-123`).
-   **messages:** array of message objects.
-   **stream:** enable streaming (optional).
-   **chatSessionId:** continue an existing session (optional).

## [Response# ](#response)

### [Success (200)# ](#success-200)

json 

```
{
  "chatSessionId": "550e8400-e29b-41d4-a716-446655440000",
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1699451234,
  "model": "myagent-123",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Response text"
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 15,
    "total_tokens": 25
  }
}
```

### [Error format# ](#error-format)

All errors return a JSON object with an `error` field:

json 

```
{
  "error": "Error message describing the issue"
}
```

### [Status codes# ](#status-codes)

Code

Description

200

Success.

400

Invalid request parameters.

401

Authentication / authorization failure.

404

Unknown model (agent).

500

Server error.

### [Common errors# ](#common-errors)

\#### Invalid request (400)

json 

```
{
  "error": "`model` is required and must be a string"
}
```

json 

```
{
  "error": "`messages` must be a non-empty array"
}
```

\#### Authentication failed (401)

json 

```
{
  "error": "Missing API key"
}
```

json 

```
{
  "error": "Invalid API key"
}
```

json 

```
{
  "error": "This API is only available on a paid plan.  Visit your dashboard to upgrade."
}
```

\#### Model not found (404)

json 

```
{
  "error": "Unknown model \"invalidagent-999\""
}
```

\#### Server errors (500)

json 

```
{
  "error": "Internal Server Error"
}
```

## [Sessions# ](#sessions)

### [New session# ](#new-session)

Omit `chatSessionId` to start fresh.

### [Continue session# ](#continue-session)

Include `chatSessionId` from the previous response. Previous messages are loaded automatically.

## [Requirements# ](#requirements)

-   Builder plan or higher (free accounts cannot access the API).
-   Valid API key from your agent's Share tab.

\*AVCodex · Your AV expertise. Amplified by AI.\*

Was this helpful? 

[Edit this page →](#)

[

Previous

Authentication

](/docs/api/authentication)[

Next

Chat Transcript

](/docs/api/chat-transcript)

On this page

-   [Endpoint](#endpoint)
-   [Request](#request)
-   [Headers](#headers)
-   [Body](#body)
-   [Parameters](#parameters)
-   [Response](#response)
-   [Success (200)](#success-200)
-   [Error format](#error-format)
-   [Status codes](#status-codes)
-   [Common errors](#common-errors)
-   [Sessions](#sessions)
-   [New session](#new-session)
-   [Continue session](#continue-session)
-   [Requirements](#requirements)

[](/)

The AI platform built exclusively for professional AV. Build, deploy, and sell AI tools that understand your industry.

### Platform

-   What You Can Build
-   Templates
-   [Pricing](/pricing)

### Services

-   [Done-For-You](/pricing)
-   [Academy](/academy)
-   [Contact](/contact)

### Company

-   About
-   [The Signal](/blog)
-   [Docs](/docs)
-   [LinkedIn](#)

© 2026 AVCodex. A Future Ready Holdings Inc. product. SOC 2 Type II Certified · HIPAA Compliant