Skip to main content
GET
/
agent_skills
/
{id}
/
file
Python
from acontext import AcontextClient

client = AcontextClient(api_key='sk_project_token')

# Get a file from a skill (text files return content, binary files return URL)
file_resp = client.skills.get_file(
    skill_id='skill-uuid-here',
    file_path='scripts/main.py',
    expire=1800  # URL expires in 30 minutes
)

print(f"File: {file_resp.path} ({file_resp.mime})")
if file_resp.content:
    print(f"Content: {file_resp.content.raw}")
if file_resp.url:
    print(f"Download URL: {file_resp.url}")
{
  "code": 123,
  "error": "<string>",
  "msg": "<string>",
  "data": {
    "content": {
      "raw": "<string>",
      "type": "<string>"
    },
    "mime": "<string>",
    "path": "<string>",
    "url": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Project Bearer token (e.g., "Bearer sk-ac-xxxx")

Path Parameters

id
string
required

Agent skill UUID

Query Parameters

file_path
string
required

File path within the skill (e.g., 'scripts/extract_text.json')

expire
integer

URL expiration in seconds for presigned URL (default 900)

Response

200 - application/json

OK

code
integer
error
string
msg
string
data
object