/jev:jevfrom jev
Provides a Go client for the TypeSafe System One API via github.com/kataras/jev. Handles closed decisions like yes/no, classification, scoring, and bounding box detection in images.
Ships in jev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Call github.com/kataras/jev. Do not hand-roll HTTP for this API, and do not use github.com/kataras/httpclient for it. This module already speaks the System One contract, including retries and the JSON wire format.
Jev returns a probability for each question you name. It does not write text. Keep generation in an LLM. Use Jev for a closed decision: yes or no, one label from a set, a position on a rubric you define, or where one thing is in an image.
SystemOne call.if status == 404).Go 1.27 or newer.
go get github.com/kataras/jev
The API key comes from the environment. jev.New reads TYPESAFE_API_KEY. Never write the key into source, tests, or logs.
client, err := jev.New()
jev.New is the constructor. There is no NewClient.
Optional client settings, in this package:
| Option | Environment | Default |
|---|---|---|
WithAPIKey | TYPESAFE_API_KEY | required |
WithBaseURL | TYPESAFE_BASE_URL | https://api.typesafe.ai |
WithModel | TYPESAFE_DEFAULT_MODEL | jev-latest |
WithLongContext | off | |
WithTimeout | 10s per attempt | |
WithRetry | DefaultRetryPolicy() | |
WithRateLimit | DefaultRateLimit(): 1,200 req/min, 250,000 tokens/s | |
WithRateLimiter | the limiter WithRateLimit builds | |
WithLogger | TYPESAFE_LOG_LEVEL | no logging |
WithHTTPClient | no redirects | |
WithHeader |
A blank string does not clear a setting. The same options may be passed to one call and apply only to that call, except WithRateLimit, which is refused per call with ErrConfig. Per call, pass WithRateLimiter(nil) to skip pacing or WithRateLimiter(l) with a limiter you own.
Model names are constants: jev.ModelLatest (jev-latest, the default), jev.ModelPreview (jev-preview), jev.ModelJev114 (jev-1.14.0), and jev.ModelJev113 (jev-1.13.0). Both aliases move. jev-latest points at jev-1.13.0 until about a week after the 1.14 release of 2026-10-14; jev-preview already points at jev-1.14.0. Pass WithModel(jev.ModelJev114) or set Request.Model when two runs must hit the same model. Box needs Jev 1.14, so pass WithModel(jev.ModelPreview) for it until jev-latest moves. Response.Model is always the versioned id. ListModels returns the names on the account.
resp, err := client.SystemOne(ctx, jev.Request{
State: "I was charged twice. Please fix this ASAP.",
Questions: jev.Questions{
"billing": jev.Noul{Instructions: "Is this ticket about billing?"},
"team": jev.Choice{
Instructions: "Which team should handle this?",
Criteria: map[string]any{
"billing": "Payments, invoices, refunds",
"technical": nil,
},
},
"urgency": jev.Score{
Instructions: "How urgent is this ticket?",
Criteria: []string{"can wait", "this week", "today"},
},
},
})
if err != nil {
return err
}
billing, ok := resp.Noul("billing")
team, ok := resp.Choice("team")
urgency, ok := resp.Score("urgency")
Rules for that shape:
State is a string, a map, a slice, or a struct with json tags. A []byte is sent as text. Nil is JSON null.Questions is a map[string]Question. Empty is ErrRequest. Names come back as answer keys. They are not part of the prompt.Noul is yes or no. The answer field is Noul (float64, 0 to 1), not a bool.Choice.Criteria is a JSON object: map[string]any, map[string]string, or a struct with json tags. A nil description is sent as null. At least one option, at most 255. A list is rejected.Score.Criteria is an ordered list, lowest level first: []string or []any. At least one level, at most 10. A map is rejected.Instructions may be a string, or a value that encodes as a JSON object or array. Nil omits the field.Noul.Criteria is an optional *NoulCriteria with True and False. Nil omits it.Box.Instructions says what to find and in which image, such as "the coffee mug in photo". There is no criteria field. The request must carry an *Image, and the model must be Jev 1.14.Request.Model overrides the client model for that call.Request.Extra adds unknown top-level JSON fields. Keys state, model, questions, and assets are rejected, and so is an *Image inside Extra.Raw (map[string]any) is for a question kind this version does not model. It needs a non-empty string type.Read every answer with the typed getter. ok == false means that name is missing or is a different kind.
if team, ok := resp.Choice("team"); ok && team.Confidence >= 0.8 {
route(team.Choice)
}
ChoiceAnswer has Choice, Confidence, and Probabilities. ScoreAnswer has Score (it may sit between levels), Confidence, Legend, and Probabilities. Legend and probability keys are "0", "1", and so on. BoxAnswer has Top, Bottom, Left, and Right (fractions 0 to 1 from the top-left corner), Confidence, and Rect(width, height) image.Rectangle. A box comes back even when the target is absent. Usage.InputTokens and Usage.OutputTokens are on the response. RequestID is the server's X-Typesafe-Request-Id.
SystemOneAs[T] decodes the response JSON into your struct. JSON names are case-sensitive. Unknown members are ignored.
type ticket struct {
Model string `json:"model"`
Answers struct {
Billing struct {
Noul float64 `json:"noul"`
} `json:"billing"`
} `json:"answers"`
}
out, err := client.SystemOneAs[ticket](ctx, req)
resp.As[ticket]() does the same decode after you already hold a *Response.
Noul, Choice, Score, and Box each send one question named answer (jev.AnswerKey) through SystemOne. Classify is Choice with the question and the options as separate arguments. Rate is Score with the levels as a list. The As methods (NoulAs, ChoiceAs, ScoreAs, BoxAs, ClassifyAs, RateAs) call SystemOneAs. In that JSON the question name is answer.
yes, err := client.Noul(ctx, ticket, "Is this about billing?")
team, err := client.Classify(ctx, ticket, "Which team?", map[string]any{
"billing": "Payments, invoices, refunds",
"technical": nil,
})
urgency, err := client.Rate(ctx, ticket, "How urgent?", []string{"can wait", "this week", "today"})
box, err := client.Box(ctx, map[string]any{"photo": photo}, "the coffee mug in `photo`", jev.WithModel(jev.ModelPreview))
Noul also accepts a jev.Noul or *jev.Noul when the question needs true and false criteria. Box takes a jev.Box or the instructions alone. Choice and Score take the structs. Several questions about the same state still belong in one SystemOne call.
Wrap a PNG or JPEG with jev.ImageFile, jev.ImageBytes, or jev.ImageReader and put the *Image where a string would go: a state value, a question's instructions, a Choice option, a struct field, or a slice element. The client swaps it for a reference string (img.Ref()), adds the assets member, sends the request as multipart/form-data, and sets the TypeSafe-Danger-Zone-Images header. Do not set that header or build the multipart body by hand. Jev 1.13 and 1.14 both accept images; only 1.14 answers jev.Box, so pass jev.WithModel(jev.ModelPreview) until jev-latest moves.
photo, err := jev.ImageFile("kitchen.jpg")
resp, err := client.SystemOne(ctx, jev.Request{
State: map[string]any{"photo": photo},
Questions: jev.Questions{
"mug_visible": jev.Noul{Instructions: "Is there a coffee mug in `photo`?"},
"mug": jev.Box{Instructions: "the coffee mug in `photo`"},
},
}, jev.WithModel(jev.ModelPreview))
mug, ok := resp.Box("mug")
crop := mug.Rect(width, height) // image.Rectangle
Mention an image inside a sentence with jev.TextOf. A fmt.Sprintf with %v does not produce the reference:
jev.Noul{Instructions: jev.TextOf("Is the dog in `photo` the same dog as in this picture: ", poster, "?")}
Rules:
Box always returns one box, even when the target is absent. Ask a Noul in the same call when the target may be missing.*Image is JSON null. An image inside a pre-encoded jsontext.Value state is not seen. An image in Request.Extra is rejected.The input limit is 64k tokens per request and 32k per question. WithLongContext(true) raises both to 262k by sending TypeSafe-Danger-Zone-Long-Context: true. Same price per token, but slower and less accurate, so pass it to the calls that need it rather than to jev.New. Jev 1.13 and 1.14 both support it.
yes, err := client.Noul(ctx, longContract, "Does the `state` include a termination clause?", jev.WithLongContext(true))
Use errors.Is and errors.As. Do not match on error strings.
| Sentinel | Meaning |
|---|---|
ErrConfig | Bad option, or no API key |
ErrRequest | Rejected before HTTP, including a nil context |
ErrResponse | 2xx body failed the contract. *ResponseError has Field |
ErrBodyTooLarge | Response body over 16 MiB. Not retried |
ErrTimeout | This client's per-attempt limit. Not the caller's context deadline |
ErrConnection | DNS, TLS, or a dropped connection |
ErrBadRequest | 400 |
ErrUnauthorized | 401 |
ErrForbidden | 403 |
ErrNotFound | 404 |
ErrUnprocessable | 422 |
ErrRateLimited | 429, after retries. *APIError has RetryAfter |
ErrOverloaded | 529 |
ErrServer | every 5xx, including 529 |
context.Canceled | Caller cancelled. Not retried |
A 529 matches both ErrOverloaded and ErrServer. Check ErrOverloaded first when the overload case matters.
The default policy retries 408, 429, and 500–599, twice, after the first attempt. Backoff starts at 500ms, doubles up to 5s, and subtracts up to 25% of the wait. Retry-After-Ms wins over Retry-After. A server delay longer than 60s falls back to backoff. It is not capped and then waited out.
There is no budget across attempts unless RetryPolicy.MaxElapsed is set. Copy DefaultRetryPolicy() and edit the copy. A zero RetryPolicy retries nothing.
policy := jev.DefaultRetryPolicy()
policy.MaxRetries = 0
client, err := jev.New(jev.WithRetry(policy))
POST is retried. Each attempt spends input tokens.
The account limit is 1,200 requests per minute and 250,000 input tokens per second. The client paces itself under that by default with a golang.org/x/time/rate token bucket: every attempt, retries included, waits on it first. Tokens are estimated from the body and corrected with usage.input_tokens. A 429 or 529 with Retry-After pauses every caller on the limiter until then.
Clients on the same key share the account budget, so give them one limiter:
shared := jev.NewLimiter(jev.DefaultRateLimit())
a, err := jev.New(jev.WithRateLimiter(shared))
b, err := jev.New(jev.WithModel(jev.ModelJev114), jev.WithRateLimiter(shared))
// or: jev.New(jev.WithRateLimiter(a.Limiter()))
Own figures, for a plan with other limits or a budget split across processes:
client, err := jev.New(jev.WithRateLimit(jev.RateLimit{RequestsPerMinute: 300, TokensPerSecond: 60_000}))
A zero field disables that axis; WithRateLimit(jev.RateLimit{}) or WithRateLimiter(nil) turns pacing off. Do not write a second rate limiter around this client. A limiter wait that outlives the context returns the context error and sends nothing.
Unit tests should use httptest and WithBaseURL plus WithAPIKey("test-key"). Do not call the live API from those tests. Pass WithRateLimiter(nil) or a small WithRateLimit when a test sends many requests, or the default 20-per-second burst slows it down. For exact timing, use testing/synctest with an in-process http.RoundTripper through WithHTTPClient; httptest.NewServer does not work inside a synctest bubble.
Live tests skip when TYPESAFE_API_KEY is empty and under go test -short. They must not print the key.
Assert on ranges and on membership in the option set you sent. Do not assert a specific probability. jev-latest moves.
These are not in the module. Do not write them, and do not tell the user they exist.
NewClient, Ask, Evaluate, Chat, Completeencoding/json (v1) for the request bodytime.Sleep or a hand-written limiter around calls; use WithRateLimit or WithRateLimiterFull signatures are in api.md. Runnable programs are examples/quickstart and examples/box in the module repo.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
Generated from the plugin's indexed repository (kataras/jev) — no native marketplace selected
npx claudepluginhub p/kataras-jev