imagesphotossearch

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.

Installation

pnpm add pexafy-ai-sdk
# Add to your .env file
PEXAFY_API_KEY=your_api_key_here

Usage

import { generateText, isStepCount } from 'ai';
import { pexafyTools } from 'pexafy-ai-sdk';

const { text } = await generateText({
  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);