Skip to main content

API Endpoints Reference

Complete reference for all Ozwell API endpoints.

Chat

Create Chat Completion

Generate a response for a conversation.

POST /v1/chat/completions

Request Body

ParameterTypeRequiredDescription
modelstringYesModel ID to use (e.g., gpt-4, gpt-3.5-turbo)
messagesarrayYesArray of message objects
temperaturenumberNoSampling temperature (0-2). Default: 1
top_pnumberNoNucleus sampling. Default: 1
nintegerNoNumber of completions to generate. Default: 1
streambooleanNoStream responses. Default: false
stopstring/arrayNoStop sequences
max_tokensintegerNoMaximum tokens to generate
presence_penaltynumberNoPresence penalty (-2 to 2). Default: 0
frequency_penaltynumberNoFrequency penalty (-2 to 2). Default: 0
toolsarrayNoList of tools (functions) available
tool_choicestring/objectNoTool selection behavior

Message Object

{
"role": "user | assistant | system | tool",
"content": "Message content",
"name": "optional_name",
"tool_calls": [],
"tool_call_id": "for_tool_role"
}

Example Request

curl https://api.ozwell.ai/v1/chat/completions \
-H "Authorization: Bearer $OZWELL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
"temperature": 0.7
}'

Response

{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1699000000,
"model": "gpt-4",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The capital of France is Paris."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 10,
"total_tokens": 35
}
}

Embeddings

Create Embedding

Generate vector embeddings for text.

POST /v1/embeddings

Request Body

ParameterTypeRequiredDescription
modelstringYesModel ID (e.g., text-embedding-ada-002)
inputstring/arrayYesText to embed
encoding_formatstringNofloat or base64. Default: float

Example Request

curl https://api.ozwell.ai/v1/embeddings \
-H "Authorization: Bearer $OZWELL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "text-embedding-ada-002",
"input": "The quick brown fox"
}'

Response

{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0023, -0.0092, 0.0156, ...]
}
],
"model": "text-embedding-ada-002",
"usage": {
"prompt_tokens": 4,
"total_tokens": 4
}
}

Files

Upload File

Upload a file for use with the API.

POST /v1/files

Request (multipart/form-data)

ParameterTypeRequiredDescription
filefileYesThe file to upload
purposestringYesPurpose: assistants, fine-tune, etc.

Example Request

curl https://api.ozwell.ai/v1/files \
-H "Authorization: Bearer $OZWELL_API_KEY" \
-F "file=@document.pdf" \
-F "purpose=assistants"

Response

{
"id": "file-abc123",
"object": "file",
"bytes": 1024000,
"created_at": 1699000000,
"filename": "document.pdf",
"purpose": "assistants"
}

List Files

List all uploaded files.

GET /v1/files

Query Parameters

ParameterTypeDescription
purposestringFilter by purpose

Response

{
"object": "list",
"data": [
{
"id": "file-abc123",
"object": "file",
"bytes": 1024000,
"created_at": 1699000000,
"filename": "document.pdf",
"purpose": "assistants"
}
]
}

Retrieve File

Get information about a specific file.

GET /v1/files/{file_id}

Delete File

Delete a file.

DELETE /v1/files/{file_id}

Retrieve File Content

Download file contents.

GET /v1/files/{file_id}/content

Models

List Models

List all available models.

GET /v1/models

Response

{
"object": "list",
"data": [
{
"id": "gpt-4",
"object": "model",
"created": 1699000000,
"owned_by": "openai"
},
{
"id": "gpt-3.5-turbo",
"object": "model",
"created": 1699000000,
"owned_by": "openai"
}
]
}

Retrieve Model

Get details about a specific model.

GET /v1/models/{model_id}

Responses (Ozwell Extension)

Extended response format with additional capabilities.

Create Response

Create a response with extended features.

POST /v1/responses

Request Body

Includes all chat/completions parameters plus:

ParameterTypeDescription
conversation_idstringID for conversation persistence
include_sourcesbooleanInclude source citations
response_formatobjectStructured output format

Example Request

curl https://api.ozwell.ai/v1/responses \
-H "Authorization: Bearer $OZWELL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4",
"messages": [{"role": "user", "content": "Summarize this document"}],
"conversation_id": "conv_abc123",
"include_sources": true
}'

Response

{
"id": "resp-abc123",
"object": "response",
"created": 1699000000,
"model": "gpt-4",
"conversation_id": "conv_abc123",
"output": {
"role": "assistant",
"content": "Here is the summary..."
},
"sources": [
{
"file_id": "file-xyz789",
"filename": "document.pdf",
"page": 3,
"excerpt": "Relevant excerpt..."
}
],
"usage": {
"prompt_tokens": 150,
"completion_tokens": 80,
"total_tokens": 230
}
}

Pagination

List endpoints support pagination:

ParameterTypeDescription
limitintegerMax items to return (1-100). Default: 20
afterstringCursor for next page
beforestringCursor for previous page

Example

# First page
curl "https://api.ozwell.ai/v1/files?limit=10" \
-H "Authorization: Bearer $OZWELL_API_KEY"

# Next page
curl "https://api.ozwell.ai/v1/files?limit=10&after=file-abc123" \
-H "Authorization: Bearer $OZWELL_API_KEY"

Versioning

The API is versioned in the URL path (/v1/). Breaking changes will result in a new version.

Current version: v1


See Also