Solutions

Engineering

Your own internal API becomes a tool.

#ml-internalprivate channel3 tool calls

An observability stack with no preset is an ordinary custom connection: a host, a credential the proxy injects, a writes policy. Asked what one document's extraction cost, it calls the API, totals the spans in the sandbox, and reports the figure with the trace it came from — correcting its own first grouping in the open.

ml-internal

Mei12:33 PM

@attest_tag what did the extraction of this document cost, end to end?

attest_tagApp12:34 PM

  • http_request · GET langfuse.internal/api/public/traces?tags=doc_id:b5be… · 1 trace
  • http_request · GET …/observations?traceId=b381… · 17 observations
  • run_js · sum cost over 5 generations

Total cost of this extraction: $0.0668 (about 6.7 cents).

  • Trace ai_assist.v2, 12:31:45 UTC, doc type bill_of_lading, status 200
  • 5 generation calls, all on the same model, all started within 50 ms of each other — parallel, not sequential batches: four table batches and one key-value pass
  • Input 74,097 tokens, output 3,184; cost per call in the table below

My first split — “four batches, then a KV call” — was wrong; re-pulling all 17 observations showed the five running in parallel. The table is from the re-pull.

google/gemini-flash12.3k in560 out$0.0063Configure

Names, figures, repositories and customers are changed; token counts and cost are illustrative. The ask, and the shape of the answer, are as they were.

How the turn went

Three fields make a connection; the credential joins at the edge.

  1. 01

    A custom connection is three fields

    The host, a credential — basic auth here — and a writes policy. Notes on the connection tell the model how the API is shaped; a domain entry lets it read the vendor’s docs without any credential.

  2. 02

    The credential joins at the edge

    The model emits a URL and a method. The proxy matches the host, injects the credential one hop before the request leaves, and scrubs the credential values back out of the response before the model or the thread sees it.

  3. 03

    Totals in the sandbox, and a correction in the open

    Seventeen observations went into run_js; five generations and a sum came out. When the first grouping was wrong, the re-pull and the correction went in the same thread.

What it needs

The setup, in the console.

Connection
A custom connection: host, credential type — bearer, basic, header, query, or a signed cloud request — allowed path prefixes and methods, writes policy. Test connection makes a check call through the proxy before you save.
Credential
Whatever the API takes. Sealed with AES-256-GCM at rest; a copy of the database is not a copy of the key.
Hosts
Only the connection's hosts. Someone tried Stripe from a channel without it and got: blocked by the proxy — host api.stripe.com is not allowed in this channel.

What it will not do

Enforced outside the model.

  • A host not on the channel's list is refused before the request leaves — the proxy decides, not the model.

  • Anything other than GET, HEAD or OPTIONS waits for a Confirm unless the connection's policy says auto.

  • Secrets that come home in a response — keys in a config endpoint, say — are redacted before the model or the thread sees them.

Try it

Say it in a channel it is in.

The sentence as it was typed. It works in any channel the bot has been invited to that carries the connection above — no command syntax, no form, and follow-ups in the thread need no mention.

@attest_tag what did the extraction of this document cost, end to end?

  • MCP server
  • http_request
  • run_js

Bring the channel this would live in.

Sign up, connect the service above in one channel, and type this sentence yourself — or run the same binary on your own infrastructure.

All solutions