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

# Doubleword Tracing

> Phoenix provides auto-instrumentation for Doubleword through the OpenAI Python library, since Doubleword exposes an OpenAI-compatible API endpoint.

[Doubleword](https://doubleword.ai/) is a high-throughput, low-cost LLM inference platform serving open models such as Qwen and DeepSeek across realtime, async, and batch tiers. The endpoint at `https://api.doubleword.ai/v1` mirrors OpenAI's schema, so any OpenAI client works with `base_url` set to Doubleword. Phoenix captures every Doubleword call through the [`openinference-instrumentation-openai`](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-openai) package, the same instrumentor that covers OpenAI's hosted API.

## Install

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
pip install arize-phoenix-otel openinference-instrumentation-openai openai
```

## Setup

Add your Doubleword API key from the **API Keys** dashboard at [app.doubleword.ai](https://app.doubleword.ai/), along with your Phoenix connection details, as environment variables:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
export DOUBLEWORD_API_KEY="<your-doubleword-api-key>"
export PHOENIX_COLLECTOR_ENDPOINT="<your-phoenix-collector-endpoint>"  # use http://localhost:6006 for local Phoenix
export PHOENIX_API_KEY="<your-phoenix-api-key>"  # required for Phoenix Cloud or authenticated Phoenix
```

Connect your application to Phoenix with the `register` function:

from phoenix.otel import register

&#x20; \# configure the Phoenix tracer
&#x20; tracer\_provider = register(
&#x20; project\_name="my-llm-app", # Default is 'default'
&#x20; auto\_instrument=True # Auto-instrument your app based on installed OI dependencies
&#x20; )

## Run Doubleword

```python theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import os
import openai

client = openai.OpenAI(
    base_url="https://api.doubleword.ai/v1",
    api_key=os.environ["DOUBLEWORD_API_KEY"],
)

response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Flash",
    messages=[
        {
            "role": "user",
            "content": "Why is the ocean salty? Answer in two sentences.",
        },
    ],
)
print(response.choices[0].message.content)
```

## Observe

Now that you have tracing set up, all invocations of the OpenAI client pointed at Doubleword will be streamed to your running Phoenix for observability and evaluation. Each request appears as a `ChatCompletion` LLM span with the prompt, response, model name, token usage, and latency.

## Common Issues

* **No traces in Phoenix**: Confirm `PHOENIX_COLLECTOR_ENDPOINT` (and `PHOENIX_API_KEY` if your Phoenix requires one) is set in the same shell that runs your app
* **Doubleword spans missing**: Call `register()` before you create the OpenAI client, and make sure `openinference-instrumentation-openai` is installed so `auto_instrument=True` picks it up
* **`401` from Doubleword**: Use your Doubleword API key from the [Doubleword dashboard](https://app.doubleword.ai/), not your OpenAI key
* **Model not found**: Use a model identifier from the [Doubleword model catalog](https://docs.doubleword.ai/inference-api/models) (e.g. `deepseek-ai/DeepSeek-V4-Flash`). Identifiers are case-sensitive and include the publisher prefix
* **Base URL**: Ensure you're using `https://api.doubleword.ai/v1` as the base URL

## Resources

> **[Doubleword Documentation](https://docs.doubleword.ai/)**
>
> Doubleword inference API docs

> **[OpenInference OpenAI Instrumentation](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-openai)**
>
> OpenAI instrumentation package
