API Documentation

Everything you need to integrate the RichAPI API into your product.

AI

AI Enrich

Enrich, classify, extract, or summarize text using OpenAI, Anthropic, Gemini, or Perplexity.

POST
/api/v1/ai_enrich
2 credits per call

Parameters

FieldTypeRequiredDescription
providerstringYesAI provider: openai, anthropic, gemini, or perplexity
promptstringYesPrompt template; use {{fieldName}} placeholders for dynamic values
modelstringNoModel override; defaults to provider default model
temperaturefloatNoSampling temperature between 0 and 2
contextobjectNoKey-value pairs used for {{placeholder}} substitution in the prompt
system_promptstringNoOptional system prompt or instructions
output_typestringNoOutput format: text or json
output_schemaobjectNoJSON schema used to guide structured output when output_type is json
max_tokensintNoMaximum output tokens; defaults to provider default
use_web_searchboolNoEnable web search when supported by the selected provider
search_domain_filterarrayNoPerplexity only; limit search to specific domains
search_recency_filterstringNoPerplexity only; filter by recency: day, week, month, year

Example response

json
{
  "content": "TexAu automates outreach workflows.",
  "finish_reason": "stop",
  "input_tokens": 18,
  "model": "gpt-4o-mini",
  "output_tokens": 12,
  "provider": "openai",
  "tokens_used": 30
}

Code

curl -X POST https://dev-api.richapi.ai/api/v1/ai_enrich \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "provider": "openai",
  "prompt": "Summarise this: {{text}}",
  "model": "gpt-4o-mini",
  "temperature": 0.3,
  "context": {
    "text": "TexAu automates outreach."
  },
  "system_prompt": "You are a concise assistant.",
  "output_type": "text",
  "output_schema": {
    "properties": {
      "summary": {
        "type": "string"
      }
    },
    "type": "object"
  },
  "max_tokens": 4096,
  "use_web_search": false,
  "search_domain_filter": [
    "openai.com"
  ],
  "search_recency_filter": "week"
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try