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

# Developer Setup

> Get up and running with Anyway

## Set Up the SDK

<Steps>
  <Step title="Create an API Key">
    <Tabs>
      <Tab title="CLI">
        ```bash theme={null}
        npm install -g @anyway-sh/cli
        anyway login
        anyway developer keys create --name "my-app"
        ```
      </Tab>

      <Tab title="Webapp">
        Sign up at [app.anyway.sh](https://app.anyway.sh), then go to **Developer** > **API Keys** and create a new SDK API key.

        <Frame>
          <img src="https://mintcdn.com/anyway/bwMVoNhJ3WPzVG0y/images/webapp/developer.png?fit=max&auto=format&n=bwMVoNhJ3WPzVG0y&q=85&s=e1af6e685c57513a9566656c47f1361e" alt="Developer API Keys page" width="2880" height="1800" data-path="images/webapp/developer.png" />
        </Frame>
      </Tab>
    </Tabs>

    <Warning>
      Keep your API key secure. Never commit it to version control.
    </Warning>
  </Step>

  <Step title="Install the SDK">
    <Tabs>
      <Tab title="Python">
        ```bash theme={null}
        pip install anyway-sdk
        ```

        Requires Python 3.10+.
      </Tab>

      <Tab title="JavaScript">
        ```bash theme={null}
        npm install @anyway-sh/node-server-sdk
        ```

        Requires Node.js 18+.
      </Tab>
    </Tabs>
  </Step>

  <Step title="Initialize the SDK">
    <Tabs>
      <Tab title="Python">
        ```python theme={null}
        from anyway.sdk import Traceloop

        Traceloop.init(
            app_name="my-app",
            api_endpoint="https://collector.anyway.sh/",
            headers={"Authorization": "your-api-key"}
        )
        ```
      </Tab>

      <Tab title="JavaScript">
        ```typescript theme={null}
        import { initialize } from "@anyway-sh/node-server-sdk";

        initialize({
          appName: "my-app",
          baseUrl: "https://collector.anyway.sh/",
          headers: { Authorization: "your-api-key" },
          disableBatch: true,
        });
        ```

        <Note>
          For ESM or Next.js projects, pass provider modules explicitly via `instrumentModules`. See [JS Configuration](/sdk/js/configuration).
        </Note>
      </Tab>
    </Tabs>
  </Step>

  <Step title="Trace Your LLM Calls">
    The SDK automatically instruments LLM calls from OpenAI, Anthropic, and other providers. Add workflow and task structure to your traces:

    <Tabs>
      <Tab title="Python">
        ```python theme={null}
        from anyway.sdk.decorators import workflow, task
        from openai import OpenAI

        client = OpenAI()

        @task(name="chat")
        def chat(prompt: str) -> str:
            response = client.chat.completions.create(
                model="gpt-4o-mini",
                messages=[{"role": "user", "content": prompt}]
            )
            return response.choices[0].message.content

        @workflow(name="answer_question")
        def answer_question(question: str) -> str:
            return chat(question)

        result = answer_question("Hello!")
        ```
      </Tab>

      <Tab title="JavaScript">
        ```typescript theme={null}
        import { withWorkflow, withTask } from "@anyway-sh/node-server-sdk";
        import OpenAI from "openai";

        const client = new OpenAI();

        async function chat(prompt: string) {
          return withTask({ name: "chat" }, async () => {
            const response = await client.chat.completions.create({
              model: "gpt-4o-mini",
              messages: [{ role: "user", content: prompt }],
            });
            return response.choices[0].message.content;
          });
        }

        async function answerQuestion(question: string) {
          return withWorkflow({ name: "answer_question" }, async () => {
            return chat(question);
          });
        }

        const result = await answerQuestion("Hello!");
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="View Your Traces">
    <Tabs>
      <Tab title="CLI">
        ```bash theme={null}
        anyway traces status          # check ingestion status
        anyway traces list --limit 5  # view recent traces
        ```
      </Tab>

      <Tab title="Webapp">
        Open [Agent Traces](https://app.anyway.sh/agent-traces) to see your workflow and task spans with execution hierarchy, duration, token usage, and cost estimates.

        <Frame>
          <img src="https://mintcdn.com/anyway/bwMVoNhJ3WPzVG0y/images/webapp/agent-traces.png?fit=max&auto=format&n=bwMVoNhJ3WPzVG0y&q=85&s=9301ecbbed66c478b3fd31d97f978bde" alt="Agent Traces page" width="2880" height="1800" data-path="images/webapp/agent-traces.png" />
        </Frame>
      </Tab>
    </Tabs>
  </Step>
</Steps>

## Next Steps

<CardGroup cols={2}>
  <Card title="Python Configuration" icon="python" href="/sdk/python/configuration">
    Configure the Python SDK.
  </Card>

  <Card title="JavaScript Configuration" icon="js" href="/sdk/js/configuration">
    Configure the JavaScript SDK.
  </Card>

  <Card title="Distributed Tracing" icon="route" href="/features/tracing">
    Learn about tracing and span attributes.
  </Card>

  <Card title="Cost Tracking" icon="dollar-sign" href="/features/cost-tracking">
    Monitor your AI spend.
  </Card>
</CardGroup>
