Skip to content

Read File

client.beta.retrieval.read(RetrievalReadParams { file_id, index_id, organization_id, 3 more } params, RequestOptionsoptions?): RetrievalReadResponse { content }
POST/api/v1/retrieval/files/read

Read the parsed text content of a specific file.

ParametersExpand Collapse
params: RetrievalReadParams { file_id, index_id, organization_id, 3 more }
file_id: string

Body param: ID of the file to read.

index_id: string

Body param: ID of the index the file belongs to.

organization_id?: string | null

Query param

formatuuid
project_id?: string | null

Query param

formatuuid
max_length?: number | null

Body param: Maximum number of characters to read from the offset.

offset?: number

Body param: Starting character offset.

ReturnsExpand Collapse
RetrievalReadResponse { content }

File read result.

content: string

Parsed text content of the file.

Read File

import LlamaCloud from '@llamaindex/llama-cloud';

const client = new LlamaCloud({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

const response = await client.beta.retrieval.read({ file_id: 'file_id', index_id: 'idx-abc123' });

console.log(response.content);
{
  "content": "content"
}
Returns Examples
{
  "content": "content"
}