ModelEndpoint
A model endpoint is how an agent reaches a model: the API the model is served through, where that API is, the key a request presents, and how hard the model works. A host makes an endpoint for each model an agent may use, from what it knows of the model and of the account it uses it under, and an agent’s adapter turns endpoints into what its agent takes: an agent in the host’s process makes an Effect AI language model of each, and an agent in a sandbox is configured with them.
Since v0.1.0
Schemas
Section titled “Schemas”Effort
Section titled “Effort”How hard a model reasons before it answers, from least to most, as providers name the levels.
Signature
declare const Effort: Schema.Literals<readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"]>Since v0.1.0
Effort (type alias)
Section titled “Effort (type alias)”Signature
type Effort = typeof Effort.TypeSince v0.1.0
ModelEndpoint
Section titled “ModelEndpoint”How an agent reaches one model.
Example (An endpoint for a model at Anthropic)
import { ModelEndpoint } from "@amends-dev/harness"import { Redacted } from "effect"
const sonnet: ModelEndpoint.ModelEndpoint = { provider: "anthropic", model: "claude-sonnet-4-5", protocol: "anthropic-messages", url: "https://api.anthropic.com/v1", apiKey: Redacted.make(process.env.ANTHROPIC_API_KEY ?? ""), effort: "medium", contextWindow: 200_000}Signature
declare const ModelEndpoint: Schema.Struct<{ readonly provider: Schema.NonEmptyString readonly model: Schema.NonEmptyString readonly protocol: Schema.Literals<readonly ["anthropic-messages", "openai-responses", "openai-chat"]> readonly url: Schema.String readonly apiKey: Schema.optionalKey<Schema.Redacted<Schema.String>> readonly headers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Redacted<Schema.String>>> readonly effort: Schema.optionalKey< Schema.Literals<readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"]> > readonly maxOutputTokens: Schema.optionalKey<Schema.Int> readonly contextWindow: Schema.optionalKey<Schema.Int>}>Since v0.1.0
ModelEndpoint (interface)
Section titled “ModelEndpoint (interface)”Signature
export interface ModelEndpoint extends Schema.Schema.Type<typeof ModelEndpoint> {}Since v0.1.0
Protocol
Section titled “Protocol”The API a model is served through: Anthropic’s Messages API, OpenAI’s Responses API, or the Chat Completions API that OpenAI defined and most providers serve.
Signature
declare const Protocol: Schema.Literals<readonly ["anthropic-messages", "openai-responses", "openai-chat"]>Since v0.1.0
Protocol (type alias)
Section titled “Protocol (type alias)”Signature
type Protocol = typeof Protocol.TypeSince v0.1.0