Create your first LLM Surface

Create your first LLM Surface in the Agent Stream dashboard, connect it to OpenAI, and send a real chat completion request in under five minutes.

By the end of this guide, you will have an active LLM Surface that accepts OpenAI-compatible chat completion requests, forwards them to OpenAI, and measures the cost of every call.

Prerequisites

  • You are logged in to the dashboard.
  • An API key from an LLM provider. This guide uses OpenAI. The same steps apply for Anthropic, Google Gemini, AWS Bedrock, Azure OpenAI, and the other providers listed in Surfaces →.

Steps

Store your API key as a secret

The Create Secret form filled in with a Secret Name, its auto-derived Secret ID, Secret Type, and the revealed Secret Value

Select Secrets in the dashboard sidebar, then select New Secret. Fill in the fields:

FieldValue
Secret NameOpenAI API key
Secret TypeApiKey
Secret ValueYour OpenAI API key.

Select Create Secret. Note the Secret ID, auto-derived from the name and shown live as you type it, even before you save; you will select it from the API Key Secret field in the next step.

Start a new surface

Under SURFACES in the sidebar, select LLM. On the LLM Surfaces page, select Add LLM Surface. The Create new LLM Surface dialog shows a list of starter templates; the list varies by appliance. Select Start blank.

The resulting canvas after selecting Start blank, with the full request and response chain already in place and every stage other than Access Point and LLM shown disabled

The surface builder opens with the canvas already populated with the full request and response chain, Access Point, Prompt Guard, Judge, the LLM node, Jury, a second Prompt Guard, and Response, plus two Expert Witness slots, all connected. Every stage besides the Access Point and LLM nodes starts disabled; only those two need configuring for a working surface, and later guides cover turning the others on. (If you picked a starter template instead, it may pre-wire the provider and model for you; skip ahead to step 4 once you’ve confirmed step 3’s settings match what you need.)

The surface is given a default name automatically. To rename the surface itself, use Configure Surface Features, reached from a button on the Access Point’s own settings panel, not that node’s Name field, which only labels the node itself on the canvas.

Configure the LLM node

The LLM node's settings panel with Provider set to OpenAI, Endpoint set to Chat Completions, Model set to GPT-5.5, and the API Key Secret from step 1 selected

The LLM node defines which provider and model this surface calls. Select it in the canvas to open its settings panel.

Set Provider to OpenAI and Endpoint to Chat Completions, then pick any model from the Model list, for example the newest GPT model shown (gpt-5.5 at the time of writing; the catalogue is hot-reloadable, so the exact list on your appliance may differ). Set API Key Secret to the secret you created in step 1.

Configure the Access Point node

The Access Point node's settings panel, showing the composed Pipe Route banner above the Listen address, Path prefix, and Custom path fields, with Custom path set to first-llm-surface-demo

The Access Point node defines how incoming requests reach the surface. Select it in the canvas to open its settings panel.

The panel shows a Pipe Route banner followed by these fields:

FieldValue for this guideNotes
Listen address(auto-seeded)Pre-filled from your appliance configuration. Accept the default.
Path prefix(auto-seeded)Pre-filled from your appliance configuration. Accept the default.
Custom pathfirst-llm-surfaceIdentifies this surface in the full route. Update the auto-seeded random value to something meaningful.

The Pipe Route banner at the top of the panel shows the composed full URL: the listen address, path prefix, and custom path combined. Copy this URL. You will use it in step 6.

Save the surface

Select the save icon in the toolbar. The surface is saved and becomes active immediately; no restart is required.

The surface after saving, now showing its assigned name and Enabled status

Send a test request

Replace <YOUR_APPLIANCE_HOST> and <YOUR_SURFACE_ROUTE> with the values from the route banner in step 4:

curl -k -X POST "https://<YOUR_APPLIANCE_HOST><YOUR_SURFACE_ROUTE>/v1/chat/completions" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [
      { "role": "user", "content": "Say hello from the Agent Stream quickstart." }
    ]
  }'

Replace gpt-5.5 with whichever model you actually selected in step 3, if different.

A successful response returns 200 OK with the OpenAI chat completion body, plus x-agent-stream-* response headers carrying the trace ID, provider, model, token counts, and cost for this call. See Observability → for the full header list.

Confirm

Open the surface’s Monitoring tab. A request entry should appear with a non-zero cost, confirming the call reached OpenAI and cost tracking is active.

The surface's Monitoring tab, showing a non-zero total cost and a request spike on the traffic chart from the test request

Troubleshooting

SymptomLikely causeFix
401 Unauthorized from OpenAIThe API key stored in the secret is incorrect or expired.Open the secret under Secrets, update its value, and save.
404 Not FoundThe URL in the curl command does not match the surface route.Copy the exact route from the Access Point node’s route banner and retry.
Connection refusedThe appliance hostname or port in your command is incorrect.Confirm the URL uses the correct listen address. Contact your administrator if the appliance appears to be unavailable.
Request succeeds but no cost appears on the Monitoring tabCost is always metered for every call; a missing figure usually means the Monitoring tab hasn’t refreshed yet, or you’re looking at the wrong surface.Wait a few seconds and refresh the Monitoring tab, and confirm you’re viewing the surface you just created.

Next steps

  • Add guardrails and a budget: Continue the tutorial with PII masking and a spend ceiling.
  • Surfaces: Understand the LLM Surface and IDE Surface routing model.
  • Pipeline and stages: Understand the Prompt Guard, Judge, Jury, and Expert Witness stages the canvas already wired up for you.