Infer × LangChain · live check langchain-openai 1.4.3
Point ChatOpenAI at Infer’s Responses endpoint.
Set a custom /v1 base URL and explicitly select the Responses API. All six captured calls—including one uncharged pre-settlement failure—stayed on /v1/responses.
Pinned setup
Install the versions that were checked.
The base URL ends at /v1; ChatOpenAI appends /responses. Keep the Infer key in the environment.
python -m pip install "langchain-openai==1.4.3" "langchain==1.3.14" "langchain-core==1.5.3" "openai==2.53.0" "pydantic==2.13.4" "httpx==0.28.1"Read current status for infer/gpt-5.6-terra:balanced, verify the account email, fund the wallet, and create a capped API key.
max_tokens=128 was the bounded text and SSE proof ceiling. The successful tool and schema pass temporarily used an 8,192-token output ceiling while the reservation defect was isolated. The deployed admission fix is recorded below; neither ceiling is a general output-policy recommendation.
import os
from langchain_openai import ChatOpenAI
model = ChatOpenAI(
model="infer/gpt-5.6-terra:balanced",
api_key=os.environ["INFER_API_KEY"],
base_url="https://infer.flow7.org/v1",
use_responses_api=True,
output_version="responses/v1",
max_retries=0,
max_tokens=128,
)
response = model.invoke("Your bounded task")
print(response.text)
This code names the exact selector and explicit Responses settings used for the dated record. Check status and test the workload before raising output or spend limits.
Dated production record
Five completions. Five receipts. $0.004369 total.
Checked August 11, 2026 with retries disabled and two temporary API keys, each capped at $0.05 daily and monthly. Both keys were revoked after request, receipt, wallet, and reservation reconciliation. This is a compatibility record, not workload or uptime certification.
rcpt_fe7ceeb6e121d0893d5195c6.rcpt_8173ca91d6fae8c83c4a0364.rcpt_68174e86177c7c88977df291.ToolMessage and completed for $0.000282: rcpt_7a76e3855b2d01555029fa6a.text.format.type = "json_schema" and returned the validated object for $0.001435: rcpt_59f0755a879243d50a333a0c./v1/responses and completed upstream, but Infer stopped settlement at reservation_invariant. Its 4,761 fresh input and 23 output tokens implied $0.001519 while the old admission path had pre-authorized $0.001000. It produced no receipt and a $0.000000 customer charge./v1/responses. No /v1/chat/completions request was observed.Claim boundary
What this proves—and what it does not.
- 01
Not a first-class LangChain provider.
Infer works through
ChatOpenAIand a custom OpenAI-compatible base URL. This is not a LangChain endorsement or a named Infer provider built into LangChain. - 02
SSE-compatible, not real-time upstream streaming.
LangChain consumed the Responses SSE sequence. Infer currently buffers the upstream response before emitting that sequence, so this record does not establish first-token latency or long-stream behavior.
- 03
One narrow local tool loop.
The proof used
bind_tools, invoked one read-only local function, and returned oneToolMessage. It did not test arbitrary tools,create_agent, LangGraph orchestration, or built-in and hosted tools. - 04
One native schema path.
The checked JSON request used Responses-native
text.format.type = "json_schema". It does not certify arbitrary schemas, multimodal input, or images. - 05
No async, state, or recovery claim.
ainvoke,astream,previous_response_id, server conversation state, background mode, retries, failover, and cancellation remain untested. Retries were set to zero. - 06
Versions and selector are bounded.
The record covers the pinned Python packages and
infer/gpt-5.6-terra:balanced. Other Infer selectors, tiers, future client releases, and broader workloads require their own checks. - 07
No supplier attestation.
The receipts prove Infer-routed requests completed and record customer charges. They do not disclose or attest the upstream supplier identity.
Start with one capped request.
Create an account, verify the email, add service credit, and check the selected route before running the pinned setup.