Neutrino Docs
SDK Reference

@neutrino-io/api-types

Canonical Zod schemas, TypeScript types, and OpenAPI-generated typed clients for Neutrino service APIs.

Package: @neutrino-io/api-types

Single source of truth for the request/response shapes consumed by Neutrino services. Zod schemas provide runtime validation; the same definitions yield static TypeScript types via z.infer. The package also ships typed openapi-fetch clients generated from each service's OpenAPI export.

// Root barrel
import {
  // schemas
  StackSchema,
  CreateStackSchema,
  ListStacksResponseSchema,
  CreateStackResponseSchema,
  PlatformSchema,
  CreatePlatformSchema,
  ListPlatformsResponseSchema,
  // typed clients
  createRegistryClient,
  createBillingClient,
  createIamClient,
  createProvisioningClient,
  createStackRegistryClient,
  createCliClient,
} from "@neutrino-io/api-types";

Subpath exports

The package publishes three entry points so consumers can avoid pulling the whole barrel:

SubpathImports
@neutrino-io/api-typesAll schemas + all typed clients (root barrel).
@neutrino-io/api-types/stacksStack schemas and inferred types.
@neutrino-io/api-types/platformsPlatform schemas and inferred types.
import { StackSchema } from "@neutrino-io/api-types/stacks";
import { PlatformSchema } from "@neutrino-io/api-types/platforms";

Stack schemas

CreateStackSchema

Request body for POST /platforms/:platformId/stacks.

FieldTypeRequiredNotes
tenantIdstringyesmin length 1
namestringyesmin length 1
isDefaultbooleannodefaults to false
templateIdstringnomin length 1 when present
repoNamestringnomin length 1 when present
type CreateStackInput = z.infer<typeof CreateStackSchema>;

StackSchema

A workspace stack as returned by the registry service.

FieldTypeNotes
idstring
tenantIdstring
platformIdstring
namestring
isDefaultboolean
templateIdstring | null
repoNamestring | null
statusstring
createdAtstringISO 8601 timestamp
updatedAtstringISO 8601 timestamp
type Stack = z.infer<typeof StackSchema>;

ListStacksResponseSchema

Paginated list response from GET /platforms/:platformId/stacks. Cursor-based pagination — cursor is null on the final page.

{
  data: Stack[]
  cursor: string | null
}
type ListStacksResponse = z.infer<typeof ListStacksResponseSchema>;

CreateStackResponseSchema

Subset of StackSchema returned by POST /platforms/:platformId/stacks.

FieldType
idstring
namestring
statusstring
isDefaultboolean
createdAtstring
type CreateStackResponse = z.infer<typeof CreateStackResponseSchema>;

Platform schemas

PlatformSchema

A platform resource as returned by the registry service.

FieldTypeNotes
idstring
namestring
slugstring
statusstring
tierstring
cfAccountIdstring | null
repoNamestring | null
createdAtstringISO 8601 timestamp
updatedAtstringISO 8601 timestamp
type Platform = z.infer<typeof PlatformSchema>;

CreatePlatformSchema

Request body for creating a platform.

FieldTypeRequiredNotes
namestringyesmin length 1
slugstringyesmin length 1
tierstringyesmin length 1
cfAccountIdstringno
repoNamestringno
type CreatePlatformInput = z.infer<typeof CreatePlatformSchema>;

ListPlatformsResponseSchema

Paginated list response from GET /platforms. Same cursor-based shape as stacks.

{
  data: Platform[]
  cursor: string | null
}
type ListPlatformsResponse = z.infer<typeof ListPlatformsResponseSchema>;

Inferred TypeScript types

Every schema has a paired z.infer alias so consumers can use the static type without re-running z.infer themselves.

SchemaInferred type
CreateStackSchemaCreateStackInput
StackSchemaStack
ListStacksResponseSchemaListStacksResponse
CreateStackResponseSchemaCreateStackResponse
CreatePlatformSchemaCreatePlatformInput
PlatformSchemaPlatform
ListPlatformsResponseSchemaListPlatformsResponse

Typed OpenAPI clients

Each Neutrino service exports an OpenAPI document at build time. api-types ships an openapi-fetch client factory per service, typed against that document.

import { createRegistryClient, createIamClient } from "@neutrino-io/api-types";

const registry = createRegistryClient({
  baseUrl: "https://registry.svc.nno.app",
});
const iam = createIamClient({ baseUrl: "https://iam.svc.nno.app" });

// Path autocompletes; response is typed.
const { data, error } = await registry.GET("/api/platforms", {
  params: { query: { limit: 50 } },
});
FactoryService
createRegistryClientservices/registry
createBillingClientservices/billing
createIamClientservices/iam
createProvisioningClientservices/provisioning
createStackRegistryClientservices/stack-registry
createCliClientservices/cli

The typed paths definitions live under @neutrino-io/api-types/dist/generated/<service> (regenerated by pnpm --filter @neutrino-io/api-types generate from each service's OpenAPI export). CI's openapi:check task fails the build if generated types drift from the live OpenAPI documents.

On this page