OpenRouter
이 Playground는 OpenRouter를 통해 버전이 고정된 Jev 모델을 호출합니다. 최신 요금과 이용 가능 여부는 모델 페이지에서 확인하세요.
- 엔드포인트
- POST https://openrouter.ai/api/alpha/decisions
- model
- typesafe/jev-1.13
- API 키
- API 키는 서버에서 Bearer 토큰으로 전송하세요.
한 상황에 대해 질문 하나 또는 서로 다른 질문 세 개를 시험해 보세요. 사례를 선택하고 입력을 바꾼 뒤 질문별 구조화된 답을 확인할 수 있습니다.
답변 유형을 하나씩 살펴보세요. 실행할 때마다 하루 이용 횟수에서 1회 차감됩니다.
사례를 실행하면 질문마다 구조화된 답이 나옵니다. Choice는 선택지를 고르고, Score는 척도의 값을, Probability는 0~1 사이의 값을 반환합니다.
이 양식은 텍스트를 state.input으로 보내고 이름이 있는 질문 1개 또는 3개를 함께 전송합니다. 각 결과는 answers.<question_id>에서 찾을 수 있습니다.
요청에서 질문과 응답 형식을 정의하면 응답에는 질문별 결과가 담깁니다. 코드 예제에 나온 JSON 필드를 하나씩 살펴보세요.
modelstatequestions<question_id>typeinstructionscriteriaanswerschoiceprobabilitiesconfidencescorelegendnoul같은 상황에 대해 Choice, Score, Probability 질문 3개를 각각 평가합니다. 실행할 때마다 하루 이용 횟수에서 1회 차감됩니다. 형식이 올바른 답도 틀릴 수 있습니다. 대표 사례를 테스트하고 워크플로에 맞는 분기 기준을 정하세요.
이 Playground는 OpenRouter를 통해 버전이 고정된 Jev 모델을 호출합니다. 최신 요금과 이용 가능 여부는 모델 페이지에서 확인하세요.
TypeSafe는 자체 엔드포인트와 API 키를 제공합니다. 공식 빠른 시작 문서는 jev-latest로 한 요청에서 여러 질문을 보내는 방법을 보여 줍니다.
Output tokens are free.
Eligible accounts may receive promotional credits. TypeSafe does not publish a fixed amount on its public pages; check the console for your balance and terms.
하네스는 모델 호출과 도구 실행 흐름을 관리합니다. 판단이 필요한 지점에서 Jev가 메시지, 실행 예정인 도구 호출 또는 에이전트 상태를 읽고 정해진 형식의 답을 돌려줍니다. 다음 단계는 코드가 결정하고, 자유로운 생성 작업은 채팅 모델이 맡습니다.
ModelRouterMiddlewarebefore_agent → wrap_model_call실행 전에 최신 사용자 메시지를 분류해 모델을 고르고 실행 내내 그 선택을 사용합니다. 선택 결과와 확률, 신뢰도는 에이전트 상태에도 남습니다.
AutoModeMiddlewarewrap_tool_call선택한 도구가 실행되기 전에 호출을 검사합니다. 위험하거나 권한이 부족하다고 판단되면 호출을 막고 오류 ToolMessage를 반환합니다. 사람에게 승인을 요청하는 기능은 아닙니다.
TypeSafeClassifierChoice · Score · Noul직접 만든 미들웨어에도 판단 지점을 넣을 수 있습니다. 에이전트 메시지나 상태를 TypeSafeClassifier에 전달하고 Choice, Score, Noul 결과에 따라 코드에서 분기하거나 사람이 검토하도록 보냅니다.
# pip install "langchain-typesafe[experimental]" langchain-openai
# Set TYPESAFE_API_KEY and OPENAI_API_KEY on your server.
from langchain.agents import create_agent
from langchain_typesafe.experimental.middleware import (
ModelChoice, ModelRouterMiddleware,
)
router = ModelRouterMiddleware(
choices={
"fast": ModelChoice(
model="openai:gpt-5.6-terra",
criteria="Simple lookups and extraction.",
),
"powerful": ModelChoice(
model="openai:gpt-6-astra",
criteria="Complex reasoning and high-stakes decisions.",
),
},
instructions="Choose the least costly model that can do the task safely.",
)
agent = create_agent("openai:gpt-5.6-terra", middleware=[router])
result = agent.invoke({"messages": [{"role": "user", "content": "Summarize this log."}]})
print(result["model_route"].choice)// Run on your server. Keep the API key out of browser code.
const apiKey = process.env.OPENROUTER_API_KEY;
if (!apiKey) throw new Error("Set OPENROUTER_API_KEY");
const response = await fetch("https://openrouter.ai/api/alpha/decisions", {
method: "POST",
headers: {
Authorization: "Bearer " + apiKey,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "typesafe/jev-1.13",
state: {input: "A customer reports a duplicate charge."},
questions: {
team: {
type: "choice",
instructions: "Which team should handle this?",
criteria: {
billing: "Payments and refunds",
technical: "Bugs and integrations"
}
},
urgency: {
type: "score",
instructions: "How urgent is the issue?",
criteria: ["Can wait", "Needs attention today", "Immediate action"]
},
escalate: {
type: "noul",
instructions: "Should a human review this first?",
criteria: {false: "No review needed", true: "Review before acting"}
}
}
})
});
if (!response.ok) throw new Error("Decision request failed");
const {answers} = await response.json();
console.log(answers.team.choice, answers.urgency.score, answers.escalate.noul);코드에 필요한 답의 형태를 선택하세요. 질문을 여러 개 보내면 각 질문 ID에 별도의 결과가 반환됩니다.
TypeSafe: Choice · Score · Noul ↗선택된 옵션의 키이며 확률이 가장 높은 선택지입니다.
각 단계의 확률을 가중치로 계산한 위치이며 두 단계 사이에 있을 수 있습니다.
예/아니요 질문에 대해 0(아니요)부터 1(예)까지의 값입니다.
실제 고객 문의와 비슷한 데이터로 테스트하고 모델 버전을 기록하세요. 불확실하거나 잘못 판단했을 때 영향이 큰 사례는 사람이 검토하도록 합니다. 0.8은 설명을 위한 값입니다.
수시로 업데이트되는 공개 저장소나 가끔 발송되는 엄선 뉴스레터에서 새로운 Jev 프로젝트, System One 커뮤니티 모델, 실제 활용 사례를 확인할 수 있습니다.