Create Chat Completion With File

OpenAI-compatible chat completions with file upload for large contexts. This endpoint accepts multipart/form-data to handle contexts larger than 1 MB. The context file is automatically uploaded to S3 and processed. Form fields: - file: The context file (text file) - messages: JSON string of chat messages - model: Model name (default: captain-voyager-latest) - stream: Enable streaming (default: true) - temperature: Sampling temperature (default: 0.7)

Request

This endpoint expects a multipart form containing a file.
filefileRequired
Context file to upload
messagesstringRequired

JSON-encoded list of chat messages

modelstringOptionalDefaults to captain-voyager-latest
streambooleanOptionalDefaults to true
temperaturedouble or nullOptionalDefaults to 0.7
max_tokensinteger or nullOptional
toolsstring or nullOptional

JSON-encoded list of tool definitions

tool_choicestring or nullOptional
Tool choice strategy

Response

Successful Response

Errors