NativePort Type Safe API
The typeSafe API from NativePort — 1 operation(s) for typesafe.
The typeSafe API from NativePort — 1 operation(s) for typesafe.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/nativeport-ai:nativeport-ai-typesafe-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Reference Type Safe API
version: 1.0.0
servers:
- url: https://api.nativeport.ai
description: NativePort production
- url: http://localhost:8787
description: Local development (wrangler dev)
tags:
- name: typeSafe
paths:
/typesafe/v1/systemone:
post:
operationId: typeSafe_systemOne
summary: Answer typed questions about supplied state
description: 'Relays to `https://api.typesafe.ai/v1/systemone`, **overwriting** `Authorization` with the
gateway''s TypeSafe key — the upstream authenticates on the same header your gateway token
arrives in, so the swap is both the injection and the strip. This is the only mounted
TypeSafe route and TypeSafe''s only billable endpoint; every other `/typesafe/*` path, and
any method other than `POST`, answers the gateway''s own `404`.
The body is forwarded as sent. It carries three required fields — `state` (the content to
evaluate, as a string, object, or array), `model`, and `questions` (a map of ids you choose
to typed question objects, answered back under the same ids). TypeSafe rejects an
unrecognized top-level field with its own `400`, so the gateway adds no second policy.
Each question is one of three types. A `noul` returns the probability the answer is yes; a
`choice` returns the picked option plus the probability of every option and a confidence; a
`score` returns a probability-weighted value across the ordered levels you describe, with
the same distribution and confidence. The state is read once however many questions ride
along, which — since billing counts input tokens only — makes batching markedly cheaper
than one call per question.
`jev-1.13.0` is the current model; `jev-latest` and `jev-preview` are aliases that may move
without notice. The response always names the concrete version that answered, so a request
for `jev-latest` comes back as `"model": "jev-1.13.0"`.
TypeSafe''s answer comes back exactly as it arrived — status, headers, and body bytes — and
the charge is settled from the `usage.input_tokens` it reports, at $0.04431 per million input
tokens (TypeSafe''s rate plus the gateway''s 5.5% fee). Output tokens are free upstream and are
not billed here.'
tags:
- typeSafe
responses:
'200':
description: 'Whatever the upstream answered, relayed as-is (status, headers, body). Rendered here as
JSON; the true shape is the upstream provider''s to define.
'
content:
application/json:
schema:
type: object
additionalProperties:
description: Any type
'401':
description: 'The bearer token was missing, unknown, or revoked. The reply body is the JSON `{ "error": "Unauthorized." }`.
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: 'No route matched the path, or the matched route disallows that method (an unlisted
`/serper/<endpoint>`, for instance). The body lists every mounted route, verbatim as the
gateway sends it. A path on one of the four model-inference routes also `404`s this way when
the specific endpoint or model isn''t on that provider''s allowlist; an unsupported model
addressed through `/inference` gets that endpoint''s own `400` instead (see the Inference tag).
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
requestBody:
content:
application/json:
schema:
type: object
properties:
state:
$ref: '#/components/schemas/TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaState'
description: The content to evaluate — text, or structured data for records, chat logs, or application state.
model:
type: string
description: The model that handles the request. A version, or one of the two aliases.
questions:
type: object
additionalProperties:
$ref: '#/components/schemas/TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaQuestions'
description: A map of ids you choose to typed question objects. Answers return under the same ids.
required:
- state
- model
- questions
security:
- bearerAuth: []
components:
schemas:
TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaQuestionsInstructions:
oneOf:
- type: string
- type: object
additionalProperties:
description: Any type
- type: array
items:
description: Any type
description: What the model should decide, rate, or answer.
title: TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaQuestionsInstructions
TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaQuestionsType:
type: string
enum:
- noul
- choice
- score
title: TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaQuestionsType
TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaQuestions:
type: object
properties:
type:
$ref: '#/components/schemas/TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaQuestionsType'
instructions:
$ref: '#/components/schemas/TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaQuestionsInstructions'
description: What the model should decide, rate, or answer.
criteria:
$ref: '#/components/schemas/TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaQuestionsCriteria'
description: Optional for `noul` (an object describing what a yes and a no mean); required for `choice` (a map of option to description, or `null`) and for `score` (an ordered array of at least two level descriptions).
required:
- type
- instructions
title: TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaQuestions
Error:
type: object
properties:
error:
type: string
description: Explanatory message meant for humans.
required:
- error
title: Error
TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaState:
oneOf:
- type: string
- type: object
additionalProperties:
description: Any type
- type: array
items:
description: Any type
description: The content to evaluate — text, or structured data for records, chat logs, or application state.
title: TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaState
TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaQuestionsCriteria:
oneOf:
- type: object
additionalProperties:
description: Any type
- type: array
items:
description: Any type
description: Optional for `noul` (an object describing what a yes and a no mean); required for `choice` (a map of option to description, or `null`) and for `score` (an ordered array of at least two level descriptions).
title: TypesafeV1SystemonePostRequestBodyContentApplicationJsonSchemaQuestionsCriteria
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: 'Your per-client bearer token — the API key the gateway issued to you. Present it in
`Authorization: Bearer <token>` form. A token that is missing, unknown, or revoked draws a
`401`. Before the call is sent upstream the token is removed (stripped, or swapped for the
upstream''s own credential); it never makes it past the gateway.
'