# Horoscope & AI Interpretations API

10 AI endpoints — part of the 700+ endpoint AstroWay platform (16 categories). 5 for horoscopes (daily, weekly, monthly, yearly, compatibility) and 5 for interpretations (natal, synastry, transits, element, placement). All built on real Swiss Ephemeris calculations (the same engine that powers Solar Fire and Astrodienst) — not on templates and not on raw LLM hallucinations.

## How it works

1. The API calculates a real astrological chart (transits, natal, synastry) via Swiss Ephemeris
2. The result is passed through our AI gateway sitting on top of best-of-breed market models (Google Gemini → Groq Llama 3.3 → OpenRouter with GPT-4 / Claude / DeepSeek → Cerebras → SambaNova → Mistral) with an astrology system prompt and automatic failover
3. The LLM generates text with built-in safety guardrails (no medical/legal/financial advice)
4. Response includes a disclaimer and audit trail

<Aside type="tip">
AI endpoints return both calculations and text. You can use just the calculations (cheaper endpoints) and generate text with your own LLM.
</Aside>

## Horoscope endpoints

| Endpoint | Credits | What it generates |
|---|---|---|
| `/v1/horoscope/daily` | 20 | Daily horoscope based on current transits |
| `/v1/horoscope/weekly` | 20 | Weekly overview |
| `/v1/horoscope/monthly` | 20 | Monthly forecast |
| `/v1/horoscope/yearly` | 50 | Annual forecast |
| `/v1/horoscope/compatibility` | 50 | Text compatibility analysis |

## Interpretation endpoints

| Endpoint | Credits | What it interprets |
|---|---|---|
| `/v1/interpret/natal` | 50 | Full natal chart interpretation |
| `/v1/interpret/synastry` | 50 | Synastry interpretation |
| `/v1/interpret/transits` | 50 | Current transit interpretation |
| `/v1/interpret/element` | 20 | Single element (planet in sign, aspect) |
| `/v1/interpret/placement` | 20 | Placement (planet in house) |

## Example

<Tabs>
  <TabItem label="cURL">
    ```bash frame="terminal"
    curl -X POST https://api.astroway.info/v1/horoscope/daily \
      -H "X-Api-Key: aw_live_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{
        "date": "1990-07-14",
        "time": "14:30:00",
        "timezoneOffset": 3,
        "latitude": 50.4501,
        "longitude": 30.5234
      }'
    ```
  </TabItem>
  <TabItem label="Node.js">
    ```ts
    const r = await fetch('https://api.astroway.info/v1/horoscope/daily', {
      method: 'POST',
      headers: {
        'X-Api-Key': process.env.ASTROWAY_API_KEY!,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        date: '1990-07-14',
        time: '14:30:00',
        timezoneOffset: 3,
        latitude: 50.4501,
        longitude: 30.5234,
      }),
    });
    const { data: horoscope } = await r.json();
    console.log(horoscope.text);
    ```
  </TabItem>
  <TabItem label="Python">
    ```python

    r = requests.post(
        'https://api.astroway.info/v1/horoscope/daily',
        headers={'X-Api-Key': os.environ['ASTROWAY_API_KEY'], 'Content-Type': 'application/json'},
        json={
            'date': '1990-07-14',
            'time': '14:30:00',
            'timezoneOffset': 3,
            'latitude': 50.4501,
            'longitude': 30.5234,
        },
    )
    horoscope = r.json()['data']
    print(horoscope['text'])
    ```
  </TabItem>
  <TabItem label="PHP">
    ```php
    <?php
    use GuzzleHttp\Client;

    $aw = new Client(['base_uri' => 'https://api.astroway.info/v1/']);
    $r = $aw->post('horoscope/daily', [
        'headers' => ['X-Api-Key' => getenv('ASTROWAY_API_KEY')],
        'json' => [
            'date' => '1990-07-14',
            'time' => '14:30:00',
            'timezoneOffset' => 3,
            'latitude' => 50.4501,
            'longitude' => 30.5234,
        ],
    ]);
    $horoscope = json_decode($r->getBody(), true)['data'];
    echo $horoscope['text'];
    ```
  </TabItem>
</Tabs>

## Safety guardrails

All AI endpoints have built-in protections:

- **System prompt** explicitly forbidding medical, legal, and financial advice
- **Auto-injected disclaimer** in every response
- **Content filter** — post-filtering on keywords
- **Audit trail** — logging of prompts and responses (90-day retention)
- **`disclaimer_inline: true`** — parameter for enterprise wanting disclaimer in the text body

<Aside type="caution">
AI interpretations are intended for entertainment. They do not replace consultation with a professional astrologer, doctor, lawyer, or financial advisor.
</Aside>

## Who uses this

- **Content platforms** — daily horoscopes for an audience
- **Astrology apps** — personalized interpretations instead of generic text
- **AI agents** — via MCP server or direct API call
- **Media** — astrology content generated from real data

## Pricing

Daily horoscope — **20 credits**. Full natal chart interpretation — **50 credits**. On the Free tier — 250 daily horoscopes or 100 interpretations per month.

<CardGrid>
  <LinkCard title="Quick start →" href="/en/getting-started/" description="First request in 5 minutes" />
  <LinkCard title="AI agents & MCP" href="/en/use-cases/ai-agents/" description="Integration with Claude, ChatGPT" />
  <LinkCard title="Pricing" href="/en/pricing/" description="From Free to Enterprise" />
</CardGrid>
