Opengram

Create a chat

POST
/api/v1/chats

Authorization

bearerAuth
AuthorizationBearer <token>

Instance secret token

In: header

Header Parameters

Idempotency-Key?string

Optional idempotency key. If provided, duplicate requests with the same key and payload return the cached response instead of creating a new resource.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/api/v1/chats" \  -H "Content-Type: application/json" \  -d '{    "agentIds": [      "string"    ],    "modelId": "string"  }'
{
  "id": "string",
  "is_archived": true,
  "title": "string",
  "title_source": "default",
  "tags": [
    "string"
  ],
  "pinned": true,
  "agent_ids": [
    "string"
  ],
  "model_id": "string",
  "last_message_preview": "string",
  "last_message_role": "string",
  "pending_requests_count": 0,
  "last_read_at": "2019-08-24T14:15:22Z",
  "unread_count": 0,
  "notifications_muted": true,
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "last_message_at": "2019-08-24T14:15:22Z"
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request.",
    "details": null
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request.",
    "details": null
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request.",
    "details": null
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request.",
    "details": null
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request.",
    "details": null
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request.",
    "details": null
  }
}