SDK Reference
Files SDK Reference
SDK reference for the Files API, available in Node.js and Python.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Orq MCP is live: Use natural language to interrogate traces, spot regressions, and experiment your way to optimal AI configurations. Available in Claude Desktop, Claude Code, Cursor, and more. Start now →
SDK reference for the Files API, available in Node.js and Python.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.files.list(limit=10)
# Handle response
print(res)
Show Parameters
{
"limit": Optional[int],
"starting_after": Optional[str],
"ending_before": Optional[str],
"project_id": Optional[str],
}
Show Response
{
"object": str,
"data": {
"file_id": str,
"purpose": Literal["FILE_PURPOSE_UNSPECIFIED", "FILE_PURPOSE_RETRIEVAL", "FILE_PURPOSE_KNOWLEDGE_DATASOURCE", "FILE_PURPOSE_BATCH"],
"file_name": str,
"bytes_": str,
"created_at": date,
"project_id": str,
},
"has_more": bool,
}
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.files.create(filename="example.file", content="<value>")
# Handle response
print(res)
Show Parameters
{
"filename": str, # required
"content": str, # required
"purpose": Optional[Literal["FILE_PURPOSE_UNSPECIFIED", "FILE_PURPOSE_RETRIEVAL", "FILE_PURPOSE_KNOWLEDGE_DATASOURCE", "FILE_PURPOSE_BATCH"]],
"content_type": Optional[str],
"project_id": Optional[str],
}
Show Response
{
"file": {
"file_id": str,
"purpose": Literal["FILE_PURPOSE_UNSPECIFIED", "FILE_PURPOSE_RETRIEVAL", "FILE_PURPOSE_KNOWLEDGE_DATASOURCE", "FILE_PURPOSE_BATCH"],
"file_name": str,
"bytes_": str,
"created_at": date,
"project_id": str,
},
}
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.files.get_content(file_id_or_path="<value>")
# Handle response
print(res)
Show Parameters
{
"file_id_or_path": str, # required
}
Show Response
{
"download_url": str,
}
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.files.get(file_id="<id>")
# Handle response
print(res)
Show Parameters
{
"file_id": str, # required
}
Show Response
{
"file": {
"file_id": str,
"purpose": Literal["FILE_PURPOSE_UNSPECIFIED", "FILE_PURPOSE_RETRIEVAL", "FILE_PURPOSE_KNOWLEDGE_DATASOURCE", "FILE_PURPOSE_BATCH"],
"file_name": str,
"bytes_": str,
"created_at": date,
"project_id": str,
},
}
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.files.delete(file_id="<id>")
# Handle response
print(res)
Show Parameters
{
"file_id": str, # required
}
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.files.update(file_id="<id>", file_name="example.file")
# Handle response
print(res)
Show Parameters
{
"file_id": str, # required
"file_name": str, # required
}
Show Response
{
"file": {
"file_id": str,
"purpose": Literal["FILE_PURPOSE_UNSPECIFIED", "FILE_PURPOSE_RETRIEVAL", "FILE_PURPOSE_KNOWLEDGE_DATASOURCE", "FILE_PURPOSE_BATCH"],
"file_name": str,
"bytes_": str,
"created_at": date,
"project_id": str,
},
}
Was this page helpful?