# Serve profile image Serve a user profile image by its file path. Retrieve and serve a user profile image file directly. The response is the raw image binary rather than a JSON object. #### Path Parameters **`file_path`** string required The file path of the profile image to serve. This value is returned in the `profile_image_url` field of the user profile. ## Returns Returns the raw image binary with the appropriate `Content-Type` header (e.g., `image/jpeg`, `image/png`). Request ```bash cURL curl "https://api.aitronos.com/v1/user/profile/images/{file_path}" \ -H "X-API-Key: $FREDDY_API_KEY" \ --output avatar.jpg ``` ```python Python import os import requests api_key = os.environ["FREDDY_API_KEY"] file_path = "usr_abc123/avatar.jpg" response = requests.get( f"https://api.aitronos.com/v1/user/profile/images/{file_path}", headers={"X-API-Key": api_key} ) with open("avatar.jpg", "wb") as f: f.write(response.content) print("Profile image saved.") ``` ```javascript JavaScript const apiKey = process.env.FREDDY_API_KEY; const filePath = "usr_abc123/avatar.jpg"; const response = await fetch( `https://api.aitronos.com/v1/user/profile/images/${filePath}`, { headers: { "X-API-Key": apiKey, }, } ); const blob = await response.blob(); const url = URL.createObjectURL(blob); // Use `url` in an tag or download it ``` Response ``` (image binary data) ``` ```json 404 Not Found { "success": false, "error": { "code": "RESOURCE_NOT_FOUND", "message": "The requested resource could not be found.", "system_message": "Profile image not found.", "type": "client_error", "status": 404, "details": { "file_path": "usr_abc123/avatar.jpg" }, "trace_id": "req_abc123xyz", "timestamp": "2025-12-22T15:30:00Z" } } ``` ## Related Resources - [Get Profile](/docs/api-reference/authentication/user-management/get-profile) - [Upload Profile Image](/docs/api-reference/authentication/user-management/upload-profile-image) - [Upload Profile Image URL](/docs/api-reference/authentication/user-management/upload-profile-image-url)