Pexafy adds semantic stock photo search to your agents: describe a scene in plain English and get real, free-to-use photographs from Unsplash, Pexels, Pixabay and six more libraries, each with an image URL, alt text, license and credit line.
# Add to your .env filePEXAFY_API_KEY=your_api_key_here
Usage
import{ generateText, isStepCount }from'ai';import{ pexafyTools }from'pexafy-ai-sdk';const{text}=awaitgenerateText({ model:'anthropic/claude-haiku-4.5', tools:pexafyTools(), stopWhen:isStepCount(5), prompt:'Find a header photo for a blog post about remote work, with its credit line.',});console.log(text);