1. Docs
  2. Integrations
  3. Dify

Use RoxyAPI with Dify

Give a Dify chatbot, agent, or workflow live access to astrology, tarot, numerology, I Ching, dreams, crystals, and angel numbers in under 20 minutes.

Dify is an open source LLM app platform. Drag nodes on a canvas, connect an LLM, and ship a working AI app without a backend. RoxyAPI slots in as either a single HTTP Request node or as a full Custom Tool with every endpoint auto-imported from our OpenAPI schema.

What you can build on Dify

  • AI astrology chatbot that routes birth-chart, daily horoscope, and synastry questions to the right endpoint
  • Tarot reading agent that pulls three-card or Celtic Cross spreads and interprets them in your brand voice
  • Life Path onboarding flow that greets users by their numerology profile
  • Vedic kundli explainer agent that picks nakshatra, dasha, or panchang sub-endpoints on its own
  • Dream interpretation bot that summarizes matching symbols from the dictionary
  • Scheduled workflow that posts the daily crystal recommendation to Slack or Notion

What you need, 30 seconds

  1. A Roxy API key. Get one on the pricing page.
  2. A Dify workspace. Free at cloud.dify.ai, or run self-hosted. The integration is identical.
  3. Five to ten minutes depending on path.

If you are new to RoxyAPI, run the quickstart curl in a terminal first. A successful JSON response confirms the key is good before you wire it into any Dify node.

Step 1, connect your first endpoint

Dify offers two paths. Pick based on scope. One endpoint, one node. Many endpoints in an agent, one Custom Tool.

For one or two fixed endpoints (daily horoscope, Life Path lookup).

  1. Open your app in Studio.
  2. Click + between nodes, pick HTTP Request.
  3. Method GET or POST.
  4. URL paste the endpoint, for example https://roxyapi.com/api/v2/astrology/horoscope/aries/daily.
  5. Scroll to Authentication, API Key, subtype Custom (not Basic, not Bearer).
  6. Header X-API-Key, Value paste your key from your account.

That is the entire setup.

The single most common mistake is leaving the subtype on Bearer. RoxyAPI uses X-API-Key as a custom header, not Authorization: Bearer. If you see 401 api_key_required, check the subtype before anything else.

For cleaner secrets handling, click Environment Variables in the left sidebar, add ROXY_API_KEY, and reference it as {{ROXY_API_KEY}} in the node value. Dify masks env vars in exports.

Step 2, ship a useful feature

Here is the full flow for an AI tarot reader. Start captures a question, HTTP Request pulls a three-card spread, LLM interprets the three cards together rather than one at a time.

  1. Start node, capture question as input.
  2. HTTP Request node:
    • Method POST
    • URL https://roxyapi.com/api/v2/tarot/spreads/three-card
    • Body JSON with {"question": "{{question}}"}
    • Auth: API Key, Custom, X-API-Key
  3. LLM node with a prompt like:

    You are a thoughtful tarot reader. Three cards were drawn for the question: {{question}}. Past: {{api.positions[0].card.name}}. Present: {{api.positions[1].card.name}}. Future: {{api.positions[2].card.name}}. Weave them into a single reading in under 250 words.

  4. Answer node returns the LLM output.

Variable substitution works everywhere in Dify. {{sign}} in a URL, {{api_response.data.items[0].id}} for deep object access, JSON body values like {{birth_lat}}.

For curl reference or an SDK equivalent outside Dify:

curl -X POST "https://roxyapi.com/api/v2/tarot/spreads/three-card" \
  -H "X-API-Key: $ROXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"question": "What should I focus on this quarter?"}'

Step 3, scale to the full surface

For focused bots, import only the domain you need. Smaller tool surface means fewer wrong tool calls from the model.

DomainSchema URLWhen to use
Western Astrologyhttps://roxyapi.com/api/v2/astrology/openapi.jsonNatal charts, horoscopes, synastry, transits
Vedic Astrologyhttps://roxyapi.com/api/v2/vedic-astrology/openapi.jsonKundli, Guna Milan, Vimshottari Dasha, panchang, KP
Tarothttps://roxyapi.com/api/v2/tarot/openapi.jsonDaily card, three-card, Celtic Cross, yes or no
Numerologyhttps://roxyapi.com/api/v2/numerology/openapi.jsonLife Path, Expression, Soul Urge, personal year
I Chinghttps://roxyapi.com/api/v2/iching/openapi.json64 hexagrams, changing lines, daily cast
Dreamshttps://roxyapi.com/api/v2/dreams/openapi.jsonSymbol dictionary, search, daily
Crystalshttps://roxyapi.com/api/v2/crystals/openapi.jsonBy zodiac, by chakra, birthstones, search
Angel Numbershttps://roxyapi.com/api/v2/angel-numbers/openapi.jsonBy number, universal lookup, daily
Biorhythmhttps://roxyapi.com/api/v2/biorhythm/openapi.jsonDaily, forecast, critical days, compatibility
Locationhttps://roxyapi.com/api/v2/location/openapi.jsonCity search, timezone, coordinates

Tour the API reference with the pre-filled test key to find the right endpoint, then paste the URL into an HTTP Request node or add the domain schema to a Custom Tool.

Gotchas

  • Backend-only key. Your Dify workspace runs server-side, so the API key lives safely in a node or env var. Never paste it into a chat prompt that gets logged or exported with the workflow.
  • Use Custom, not Bearer. The X-API-Key header is a custom header. Leaving the Authentication subtype on Bearer is the single most common integration failure.
  • Timezone. Prefer IANA strings like "Asia/Kolkata" or "America/New_York". Decimal offsets like 5.5 are accepted but do not handle daylight saving. The server resolves IANA to the DST-correct offset for the request date.
  • Rate limits. Every Roxy plan has daily and monthly caps. Agents that burn tools/call on every turn can eat a month of quota in hours. Add a decision node that only calls Roxy when the user question is on topic.
  • Tool surface discipline. The full OpenAPI import gives your agent every endpoint. For smaller models (GPT-3.5, Mistral 7B), use per-domain schemas instead. Fewer tools means fewer wrong picks.
  • Per-request billing. tools/list is free on our MCP endpoints, but every tools/call or HTTP request counts as a billable Roxy call.

What to build next