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

# Intro to Waystone

> The unified LLM gateway making developing AI apps easy.

## What is Waystone?

Your application starts with just a single LLM query, which is easy enough to manage.
But now you're getting users and need control usage to limit costs.
Then you add different pricing tiers - how do you track users' token usage and limit access to the product?
Oh, and what if OpenAI goes down? Now you need to set up a fallback to Anthropic.
And what if people start abusing the application, how do you monitor for abuse or block their access?
And then, and then, and then...

**Waystone** takes care of all the difficult, boring, extra stuff that you *shouldn't have to build* when creating AI applications:

* Routing to different models and providers for different prompts/use-cases
* [Model fallbacks](./cookbooks/model-fallback.mdx) (e.g. for when OpenAI is down)
* Monitoring per-user usage (cost, limits, abuse, etc.)
* [Per-user model access](./cookbooks/free-user-routing.mdx) (e.g. different pricing tiers, regions, domains)
* *(COMING SOON)* Monitoring and analysing prompts and responses
* *(COMING SOON)* A/B testing models and prompts
* *(COMING SOON)* Sanitising responses (blocking, censoring, structure-enforcement, etc.)
* .... and so much more

## Get started

Start by forwarding your LLM requests through our gateway with a two-line change to your
code, then take advantage of our powerful rules engine and observability tooling (coming
soon!) to route requests, set model fallbacks, retries, and more based on which of your
users is making the request.

<CodeGroup>
  ```diff TypeScript theme={null}
    const client = new OpenAI({
  -   apiKey: process.env['OPENAI_API_KEY'],
  +   apiKey: process.env['WAYSTONE_API_KEY'],
  +   baseURL: 'https://waystone.run/api/gateway/v1',
    });

    const response = await client.responses.create({
      model: 'gpt-4o',
      instructions: 'You are a coding assistant that talks like a pirate',
      input: 'Are semicolons optional in JavaScript?',
    });
  ```

  ```diff Python theme={null}
    client = OpenAI(
  -     api_key=os.environ.get("OPENAI_API_KEY"),
  +     api_key=os.environ.get("WAYSTONE_API_KEY"),
  +     base_url="https://waystone.run/api/gateway/v1",
    )

    response = client.responses.create(
        model="gpt-4o",
        instructions="You are a coding assistant that talks like a pirate.",
        input="How do I check if a Python object is an instance of a class?",
    )
  ```
</CodeGroup>

## What's Next?

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Set up your Waystone account, integrate with the gateway and create your first
    rule.
  </Card>

  <Card title="API reference" icon="code" href="/api-reference">
    Check out our REST API reference. Our gateway API is a super-powered superset of
    the OpenAI API, and is fully compatible!
  </Card>

  <Card title="Checkout an example usecase" icon="users" href="/cookbooks/free-user-routing">
    See a recipe for managing how users in different pricing tiers can access different models in your application.
  </Card>
</CardGroup>
