> ## Documentation Index
> Fetch the complete documentation index at: https://lightsage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart: get your first API evaluation in 10 min

> Create a free Lightsage account, add your API, run your first evaluation, and install agent tracking middleware to start measuring AI visibility.

This guide walks you through everything from account creation to your first real evaluation result. You'll finish with a Visibility Score, an API Performance baseline, and live agent tracking on your docs — no credit card required to start.

<Steps>
  <Step title="Create your account">
    Go to [app.lightsage.com](https://app.lightsage.com/welcome) and sign up with your email. No credit card is required. Your account starts with 250 free credits — enough to run your first evaluations across multiple platforms.

    <Note>
      The free plan includes 3 prompts per day across 1 AI platform. Upgrade to Pro (\$100/month) to unlock all 17 platforms and 1,500 credits per month.
    </Note>
  </Step>

  <Step title="Add your API">
    After signing in, add your API by providing either:

    * **A documentation URL** — Lightsage crawls your docs and detects endpoints, authentication patterns, and SDK information automatically
    * **A GitHub repository URL** — Lightsage reads your README, OpenAPI spec, and code examples

    You can also add competitors at this step. Lightsage will track your share of voice against them across every prompt it runs.
  </Step>

  <Step title="Run your first evaluation">
    Once your API is added, run an evaluation from the dashboard. Lightsage sends implementation-style prompts to coding agents and answer engines — the kind of prompts developers actually use when building:

    * "Add \[your API] to my Next.js app"
    * "Set up authentication with \[your API]"
    * "Connect \[your API] with \[common integration]"

    Each coding agent evaluation costs 5 credits and executes real tool calls against your endpoints. Answer engine evaluations cost 1 credit each.

    <Tip>
      Start with 2–3 implementation prompts that match your most common developer use cases. You can add more after reviewing your baseline results.
    </Tip>
  </Step>

  <Step title="Read your Visibility Score and API Performance results">
    After your evaluation completes, you'll see two sets of results:

    **Visibility Score** — A 0–100 score reflecting how often AI platforms recommend your API for relevant prompts, weighted by platform reach and prompt intent. You'll also see your share of voice against each competitor you added.

    **API Performance** — Endpoint-level scores across coding agents. For each endpoint, Lightsage reports:

    * **Eval score** — Overall pass rate across all test runs
    * **Discovery score** — Whether agents find the correct endpoint
    * **Tool call success rate** — Whether generated code executes without errors
    * **Error recovery rate** — Whether agents can fix failures when they occur
    * **Time to completion** — How long agents take to finish a task using your endpoint

    Look for endpoints with low tool call success rates — these are where agent-generated code is failing, which translates directly to developer frustration.

    <Warning>
      A high Visibility Score combined with a low API Performance score means agents are recommending you but the generated code doesn't work. Fix usability issues before driving more visibility.
    </Warning>
  </Step>

  <Step title="Install agent tracking middleware">
    Add one line of middleware to your Next.js app to detect which AI coding agents are visiting your docs and API endpoints in real time. This gives you live data on agent traffic without any performance impact.

    ```typescript middleware.ts theme={null}
    import { withAgentTracking } from '@lightsage/agent-tracker/next';

    export default withAgentTracking({
      apiKey: process.env.LIGHTSAGE_API_KEY
    });

    export const config = {
      matcher: ['/((?!api|_next|admin).*)'],
    };
    ```

    Install the package first:

    ```bash theme={null}
    npm install @lightsage/agent-tracker
    ```

    Then add your `LIGHTSAGE_API_KEY` to your environment variables. You can find your key in the Lightsage dashboard under **Settings → API Keys**.

    The middleware detects Claude Code, OpenCode, Cursor, Codex, and 6+ other coding agents visiting your site. Traffic appears in your dashboard under **Agent Analytics** within a few minutes.

    <Note>
      The `matcher` pattern in the config excludes `/api`, `/_next`, and `/admin` routes by default. Adjust this to match your site structure.
    </Note>
  </Step>

  <Step title="Set up prompt tracking">
    Prompt tracking runs your defined prompts across AI platforms on a schedule — daily or every other day — so you can monitor visibility trends over time instead of taking one-off snapshots.

    To set up prompt tracking:

    1. Go to **Prompt Tracking** in your dashboard
    2. Click **Add prompt** and enter an implementation-style prompt
    3. Select which AI platforms to run it on (answer engines cost 1 credit/run, coding agents cost 5 credits/run)
    4. Set a run frequency — daily for fast-moving competitive situations, alternate days for steady-state monitoring
    5. Save and Lightsage will run the prompt automatically on your schedule

    Your results accumulate over time, letting you see whether changes to your docs, llms.txt, or API responses are improving your visibility and usability scores.
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Understand your results" icon="book-open" href="/docs/key-concepts">
    Learn what Visibility Score, Share of Voice, and API Performance metrics mean in detail.
  </Card>

  <Card title="Improve API Performance" icon="gauge-high" href="/docs/features/api-performance">
    Dig into endpoint-level scores and fix tool call failures.
  </Card>

  <Card title="Optimize for discovery" icon="magnifying-glass" href="/docs/guides/optimize-for-agents">
    Add llms.txt, fix robots.txt, and improve error messages to boost agent recommendations.
  </Card>

  <Card title="Devtool Arena" icon="trophy" href="/docs/leaderboard/overview">
    See how your API ranks publicly against competitors on the free leaderboard.
  </Card>
</CardGroup>
