pexafy-ai-sdk gives AI SDK agents three tools to find real, free-to-use
photos (Unsplash, Pexels, Pixabay and more). Each photo comes back with its URL, alt text,
licence and credit line.
Install
PEXAFY_API_KEY. Create a free key at
pexafy.com/dashboard/api-keys/create (no card).
Use
Tools
| Function | Arguments the model fills |
|---|---|
searchPhotos() | query, optional orientation (landscape, portrait, square), count |
findSimilarPhotos() | photo_id, optional count |
getPhoto() | photo_id |
pexafyTools() returns all three. Options on each: apiKey, maxResults (default 6, max 20),
timeoutMs (default 30000), maxRetries (default 2).
Output
Each photo is one record:credit line next to each photo you publish.
Errors
A spent quota, an unknownphoto_id or an invalid key reaches the model as a tool error.
A per-minute rate limit, a server error or a network failure is retried automatically.
See Errors & rate limits.
Source on GitHub · npm · MIT