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

# Quickstart

### 1. Configure Your Environment

Set up your environment variables to connect to Future AGI. Get your API keys [here](https://app.futureagi.com/dashboard/keys)

<CodeGroup>
  ```python Python theme={null}
  import os
  os.environ["FI_API_KEY"] = "YOUR_API_KEY"
  os.environ["FI_SECRET_KEY"] = "YOUR_SECRET_KEY"
  ```

  ```typescript JS/TS theme={null}
  process.env.FI_API_KEY = "YOUR_API_KEY";
  process.env.FI_SECRET_KEY = "YOUR_SECRET_KEY";
  ```
</CodeGroup>

### 2. Register Your Prototype Project

Register your project with the necessary configuration.

<CodeGroup>
  ```python Python theme={null}
  from fi_instrumentation import register, Transport
  from fi_instrumentation.fi_types import ProjectType, EvalName, EvalTag, EvalTagType, EvalSpanKind, ModelChoices

  # Setup OTel via our register function
  trace_provider = register(
      project_type=ProjectType.EXPERIMENT,  
      project_name="FUTURE_AGI",            # Your project name
      project_version_name="openai-exp",    # Version identifier for this prototype
      transport=Transport.HTTP,             # Transport mechanism for your traces
      eval_tags = [
          EvalTag(
              eval_name=EvalName.TONE,
              value=EvalSpanKind.LLM,
              type=EvalTagType.OBSERVATION_SPAN,
              model=ModelChoices.TURING_LARGE,
              mapping={
                  'input' : 'llm.input_messages'
              },
              custom_eval_name="<custom_eval_name2>",
          ),
      ]
  )
  ```

  ```typescript JS/TS theme={null}
  import { register, Transport, ProjectType, EvalName, EvalTag, EvalTagType, EvalSpanKind, ModelChoices } from "@traceai/fi-core";

  const tracerProvider = await register({
      projectName: "FUTURE_AGI",
      projectType: ProjectType.EXPERIMENT,
      transport: Transport.HTTP,
      projectVersionName: "openai-exp", // Version identifier for this prototype
      evalTags: [
        await EvalTag.create({
          type: EvalTagType.OBSERVATION_SPAN,
          value: EvalSpanKind.LLM,
          eval_name: EvalName.CHUNK_ATTRIBUTION,
          custom_eval_name: "Chunk_Attribution",
          mapping: {
            "context": "raw.input",
            "output": "raw.output"
          },
          model: ModelChoices.TURING_SMALL
        })
      ]
  });
  ```
</CodeGroup>

### Configuration Parameters:

| Property (Python)      | Property (TypeScript) | Description                                                                                                                                          |
| ---------------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `project_type`         | `projectType`         | Set as `ProjectType.EXPERIMENT` for Prototyping                                                                                                      |
| `project_name`         | `projectName`         | A descriptive name for your project                                                                                                                  |
| `project_version_name` | `projectVersionName`  | (optional) A version identifier for this prototype, enabling comparison between different iterations                                                 |
| `eval_tags`            | `evalTags`            | (optional) Define which evaluations to run on your prototype as a list of `EvalTag` objects. [Learn more →](/future-agi/get-started/prototype/evals) |
| `transport`            | `transport`           | (optional) Set the transport for your traces. The available options are `GRPC` and `HTTP`.                                                           |

> **Note:**\
> Python uses `snake_case` for property names (e.g., `project_type`), while TypeScript uses `camelCase` (e.g., `projectType`). Always use the convention appropriate for your language.

## Instrument your project:

There are 2 ways to implement tracing in your project

1. Auto Instrumentor : Instrument your project with FutureAGI's Auto Instrumentor. Recommended for most use cases.
2. Manual Tracing : Manually track your project with Open Telemetry. Useful for more customized tracing.

### Example: Instrumenting with Auto Instrumentor ( OpenAI )

First, install the traceAI openai package:

<CodeGroup>
  ```bash Python theme={null}
  pip install traceAI-openai
  ```

  ```bash JS/TS theme={null}
  npm install @traceai/openai
  ```
</CodeGroup>

Instrument your project with FutureAGI's OpenAI Instrumentor.

<CodeGroup>
  ```python Python theme={null}
  from traceai_openai import OpenAIInstrumentor

  OpenAIInstrumentor().instrument(tracer_provider=trace_provider)
  ```

  ```typescript JS/TS theme={null}
  import { OpenAIInstrumentation } from "@traceai/openai";
  import { registerInstrumentations } from "@opentelemetry/instrumentation";

  const openaiInstrumentation = new OpenAIInstrumentation({});

  registerInstrumentations({
    instrumentations: [openaiInstrumentation],
    tracerProvider: tracerProvider,
  });
  ```
</CodeGroup>

Initialize the OpenAI client and make OpenAI requests as you normally would. Our Instrumentor will automatically trace these requests for you, which can be viewed in your [Prototype dashboard](https://app.futureagi.com/dashboard/projects/experiment).

<CodeGroup>
  ```python Python theme={null}
  from openai import OpenAI

  os.environ["OPENAI_API_KEY"] = "your-openai-api-key"

  client = OpenAI()

  completion = client.chat.completions.create(
      model="gpt-4o",
      messages=[
          {
              "role": "user",
              "content": "Write a one-sentence bedtime story about a unicorn."
          }
      ]
  )

  print(completion.choices[0].message.content)
  ```

  ```typescript JS/TS theme={null}
  import { OpenAI } from "openai";

  const client = new OpenAI({
      apiKey: process.env.OPENAI_API_KEY,
  });

  const completion = await client.chat.completions.create({
      model: "gpt-4o",
      messages: [
          {
              "role": "user",
              "content": "Write a one-sentence bedtime story about a unicorn."
          }
      ]
  });

  console.log(completion.choices[0].message.content);
  ```
</CodeGroup>

To know more about the supported frameworks and how to instrument them, check out our Auto Instrumentation page.
