API Reference

Complete reference for the Chat Completions endpoint

API Reference

Endpoint

POST https://app.chipp.ai/api/v1/chat/completions

Request

Headers

HeaderRequiredDescription
AuthorizationYesBearer YOUR_API_KEY
Content-TypeYesapplication/json
X-Chat-Session-IDNoAlternative session ID
X-Correlation-IDNoRequest tracking ID

Body

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

Parameters

  • model: Your Chipp application's appNameId (format: appname-123)
  • messages: Array of message objects
  • stream: Enable streaming (optional)
  • chatSessionId: Continue existing session (optional)

Response

Success (200)

{
  "chatSessionId": "550e8400-e29b-41d4-a716-446655440000",
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1699451234,
  "model": "myapp-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

All errors return a JSON object with an error field:

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

Status Codes

CodeDescription
200Success
400Invalid request parameters
401Authentication/authorization failure
404Unknown model (app)
500Server error

Common Errors

Invalid Request (400)

{
  "error": "`model` is required and must be a string"
}
{
  "error": "`messages` must be a non-empty array"
}

Authentication Failed (401)

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

Model Not Found (404)

{
  "error": "Unknown model \"invalidapp-999\""
}

Server Errors (500)

{
  "error": "Internal Server Error"
}

Sessions

New Session

Omit chatSessionId to start fresh.

Continue Session

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

Requirements

  • Pro plan or higher (Free accounts cannot access the API)
  • Valid API key from your application's Share tab