Analyze Uploaded File
Analyze an uploaded file and return comprehensive analysis results with intelligent caching.
Behavior:
- If no query provided: Returns summary analysis (cached if available)
- If query provided: Returns both summary (from cache if available) and fresh question analysis
Billing: analysis_request is token-based — quantity = ceil(total_tokens / 15000). One unit is charged up front as a credit gate; additional units are topped up at the end if the LLM call exceeded 15,000 tokens. The file’s transcript is read locally from your storage — no proxy fetch is involved. Set include_usage=true to receive the per-charge breakdown.
Optional: set transcript_text=true to return the transcript as a single text string instead of an array of segments.
Overview
Similar to Analyze Video, but operates on files in your library.Request Body
file_id(string, required): ID of the uploaded file to analyzequery(string, optional): Ask a specific question about the content
Billing
File analysis consumesanalysis_request units based on context size. One unit covers up to 15,000 total tokens, and longer contexts are billed with ceil(total_tokens / 15000). For example, an analysis that uses 17,000 total tokens consumes 2 analysis_request units. One unit is charged up front as a credit gate; additional units are topped up at the end if the LLM call exceeded 15,000 tokens.
The file’s transcript is read locally from your storage — no proxy fetch is involved, so no standard_request / residential_request is charged.
Set include_usage: true to receive a usage block with the per-charge breakdown.
Example Request
Authorizations
API key authentication. Include your VidNavigator API key in the X-API-Key header.
Body
ID of the uploaded file to analyze
Optional question about the file content
"What is discussed in this file?"
When true, returns the transcript as a single plain-text string instead of an array of segments.
When true, the response includes a usage block listing every meter charged during this request, the total credits deducted, and the user's remaining balance.
Response
File analyzed successfully
success Per-call usage disclosure. Returned only when the caller passes include_usage=true in the request body. Lists every meter that fired during this request and the credits actually deducted. Multiple charges of the same meter inside one request are consolidated into a single entry (their quantities and credits are summed). When a charge was waived through a cache-hit sponsorship (e.g. NGO), it carries waived: true + credits_saved, and a top-level waived.credits_saved summary appears.
For endpoints that involve LLM analysis (/extract/video, /extract/file, /analyze/video, /analyze/file, /youtube/search), the consolidated analysis_request charge entry carries a nested tokens object reporting the LLM input/output token tally for the request.

