Configuration
Scalar SDK generation is driven by a single config object: which languages to generate, the resource tree the clients expose, the environments they can reach, and how each package is named, versioned, and published.
The top-level targets map controls which artifacts are generated, while resources controls the public client shape.
For SDK behavior embedded in an OpenAPI document instead, see OpenAPI Extensions. Root-level Scalar extensions mirror the configuration blocks below, while operation and schema extensions refine individual generated methods and types.
Minimal config
Every property the schema requires, with a real value apiece. $schema is the one addition: it is not required, and an editor that reads it validates the file and completes its keys as you type.
{
"$schema": "https://registry.scalar.com/@scalar/schemas/sdk-config",
"organization": {
"name": "Acme"
},
"environments": {
"production": "https://api.acme.com"
},
"environmentOrder": [
"production"
],
"targets": {
"typescript": {
"packageName": "@acme/api"
},
"python": {
"packageName": "acme_api",
"projectName": "acme-api"
},
"cli": {
"binaryName": "acme"
}
},
"resources": {
"users": {
"methods": {
"list": "get /users",
"create": "post /users"
},
"models": {
"User": "User"
}
}
}
}
Properties
| Property | Description |
|---|---|
organization* |
Identity of the organization publishing the SDKs. Its name also names the SDK and its generated client. |
resources* |
Resource tree that drives the generated client and resource shape. |
targets* |
Per-language packaging, publishing, and generation options, keyed by target id. |
environments* |
Named base URLs the generated client can switch between. |
environmentOrder* |
Order the generated client lists environments in; the first entry is the default. |
readme |
Generated README content: its heading, whether it credits the generator, and the example requests its sections render. |
customCasings |
SDK symbol casing overrides, including initialisms. A key may span several words when written with separators (three_ds, not threeDS), and then matches that word sequence anywhere in a generated name. A multi-word key needs an explicit pascal or camel spelling, since initialism applies to a single word; whichever one it declares spells both PascalCase and camelCase names. snake_case names already spell the key as written. |
clientSettings |
SDK-wide client constructor settings for auth, retries, timeouts, and headers. |
pagination |
Named pagination schemes referenced by method-level pagination settings. |
querySettings |
Query string serialization preferences shared by generated request builders. |
multipartSettings |
Multipart/form-data serialization preferences shared by generated request builders. |
settings |
Generator behavior shared by every target. |
openapi |
OpenAPI-adjacent config such as code samples and auth overrides. |
grpc |
How proto services become SDK methods: which protos are compiled, the wire protocol generated clients speak, per-service placement and naming, and RPCs to drop. Under transcode, an RPC with no usable google.api.http annotation falls back to a Connect call and is reported. |
errors |
Error response interpretation settings used by generated runtimes. |
ignoredEndpoints |
Endpoints to drop from generation entirely, even when a resource places them. Equivalent to skip: true on the placed method. Written as "<verb> <path>" for HTTP operations and "grpc <package>.<Service>/<Method>" for RPCs generated from a proto. |
streaming |
Global streaming behavior and event handling hints. |
models |
Models not tied to a resource, keyed by component name. Used to carry settings (e.g. skipProperties) for component schemas that no resource lists. |
diagnostics |
When diagnostics fail the build, per-rule severity overrides, and suppressions. |
organization
{
"organization": {
"name": "Acme",
"docs": "https://docs.acme.com",
"contact": "sdk@acme.com",
"securityContact": "security@acme.com"
}
}
| Property | Description |
|---|---|
name* |
Organization or company publishing the SDKs. Used as the author of generated packages and as the name the SDK and its client are derived from. |
docs |
URL of the API documentation site, linked from generated package metadata. |
contact |
Email address for SDK feedback, questions, and support requests, surfaced in generated package metadata. |
securityContact |
Email address API vulnerability reports should go to, named in the generated security policy. Every target generates one, and each sends reports about the generated SDK code itself to Scalar instead, whether or not this is set. |
logo |
Logo shown at the top of the page the generated CLI serves when a browser sign-in finishes: an https URL, or a data:image/... URI to keep the page from fetching anything. The page follows the viewer's light or dark mode, so use a logo that reads on both a white and a near-black background. Omit it and the page shows no logo, since generated SDKs carry no branding but the publisher's own. |
resources
{
"resources": {
"users": {
"methods": {
"list": "get /users",
"create": {
"kind": "http",
"endpoint": "post /users"
}
},
"models": {
"User": "User"
},
"subresources": {
"billing": {
"methods": {
"listInvoices": "get /users/{user_id}/invoices"
}
}
}
}
}
}
Each resource can carry generated methods, public models, nested subresources, default request options, and per-target visibility rules.
Use skip to omit a method, model, or resource globally or for specific targets. Use only to restrict it to a list of targets.
targets
{
"targets": {
"typescript": {
"packageName": "@acme/api",
"destinations": {
"production": {
"repo": "acme/acme-typescript"
}
}
},
"python": {
"packageName": "acme_api",
"projectName": "acme-api"
},
"cli": {
"binaryName": "acme",
"defaultFormat": "json"
}
}
}
Supported target keys are typescript, python, go, rust, java, kotlin, swift, ruby, php, csharp, cpp, dart, and cli.
Set skip: true on a target to keep its config in place without generating it.
Set promotion: "manual" on a target to hold each build at staging until you promote it, instead of pushing to its production repository automatically. See GitHub Repositories.
environments
{
"environments": {
"production": "https://api.acme.com",
"sandbox": "https://sandbox.acme.com"
},
"environmentOrder": [
"production",
"sandbox"
]
}
environments maps a name to a base URL; environmentOrder fixes the order the generated client lists them in, and its first entry is the environment a client uses when none is chosen.
clientSettings
{
"clientSettings": {
"opts": {
"apiKey": {
"type": "string",
"description": "API key for Acme.",
"readEnv": "ACME_API_KEY",
"securityScheme": "apiKey",
"role": "value"
}
},
"defaultHeaders": {
"X-Acme-SDK": "true"
},
"defaultClientName": "Acme",
"defaultEnvPrefix": "ACME",
"defaultTimeout": 30000,
"defaultRetries": {
"maxRetries": 2,
"initialDelaySeconds": 1,
"maxDelaySeconds": 10
}
}
}
Client options can send values in headers, query parameters, body parameters, or path parameters, though not every target supports every location. They can also map to OpenAPI security schemes or server variables.
pagination
Define reusable pagination schemes in pagination, then bind them to methods with paginated. See Pagination for the full field vocabulary, one worked example per strategy, and the helpers each target generates.
{
"pagination": [
{
"name": "cursor",
"type": "cursor",
"request": {
"cursor": {
"type": "cursor",
"param": "cursor",
"location": "query"
}
},
"response": {
"items": {
"type": "items",
"location": "body",
"path": [
"data"
]
},
"next": {
"type": "cursor",
"location": "body",
"path": [
"next_cursor"
]
}
}
}
]
}
Bind a scheme to a method with paginated, which takes a scheme name, or false to keep the method unpaginated:
{
"resources": {
"users": {
"methods": {
"list": {
"kind": "http",
"endpoint": "get /users",
"paginated": "cursor"
}
}
}
}
}
A scheme nothing references is reported as unused rather than silently ignored.
Supported pagination types are cursor, cursorId, cursorUrl, fakePage, offset, and pageNumber.
querySettings
{
"querySettings": {
"arrayFormat": "repeat",
"nestedFormat": "brackets"
},
"multipartSettings": {
"arrayFormat": "brackets"
}
}
| Property | Description |
|---|---|
nestedFormat |
Object/nested query serialization strategy. |
arrayFormat |
Array query serialization strategy. |
nestedFormat
Allowed values: "brackets", "dots"
arrayFormat
Allowed values: "comma", "repeat", "indices", "brackets"
multipartSettings
| Property | Description |
|---|---|
arrayFormat |
Array serialization strategy for multipart/form-data fields. |
arrayFormat
Allowed values: "comma", "repeat", "indices", "brackets"
openapi
{
"openapi": {
"codeSampleLanguages": {
"typescript": true,
"python": true,
"cli": true
},
"security": [
{
"apiKey": []
}
],
"securitySchemes": {
"apiKey": {
"type": "apiKey",
"name": "X-API-Key",
"in": "header"
}
},
"operationSecurity": true
}
}
{
"openapi": {
"securitySchemeSettings": {
"OAuth": {
"resource": [
"https://api.example.com"
],
"audience": "https://api.example.com"
}
}
}
}
These sit next to the source API document rather than in it: they override its security for the generated SDKs, transform it before generation, and control the code samples and tags written to the augmented OpenAPI document the generator writes, without editing the document you maintain.
securitySchemeSettings adds what an OpenAPI security scheme has no field for, keyed by scheme id. Unlike securitySchemes, an entry does not replace the scheme. For an OAuth 2.0 or OpenID Connect scheme, resource (RFC 8707 resource indicators) and audience name the API a token is requested for, so an authorization server that fronts several APIs issues one this API accepts. Each generated client that requests tokens sends them: the Rust SDK's client-credentials exchange, and every request the CLI's login makes, the refresh included. A key naming no OAuth 2.0 or OpenID Connect scheme does nothing, and generation reports it as Config/UnusedSecuritySchemeSettings.
diagnostics
{
"diagnostics": {
"failOn": "error",
"maxWarnings": 20,
"rules": {
"Endpoint/NotConfigured": "warn"
}
}
}
Every build analyzes your OpenAPI document and this configuration together and reports what generation had to skip, guess, or degrade. See Diagnostics for how the analysis works and the full list of rules.
| Property | Default | Description |
|---|---|---|
failOn |
"error" |
Lowest severity that fails the build; off means no severity fails it. |
maxWarnings |
Maximum allowed warnings before the build fails. | |
maxErrors |
Maximum allowed errors before the build fails. | |
rules |
Per-rule severity override keyed by rule id (e.g. Endpoint/NotConfigured); off disables the rule. |
|
ignored |
Per-rule suppressions keyed by rule id. |
failOn
Allowed values: "off", "info", "warn", "error"
maxWarnings
Constraints: minimum: 0
maxErrors
Constraints: minimum: 0