Customize method names
You can fine-tune your SDK method and group names to create intuitive, user-friendly code that matches your API’s purpose.
For example, instead of client.postUsers
you can configure your SDK to read client.users.create().
How it works for SDK users
Here’s how developers using your generated SDK would call the customized method
name client.users.create() in their applications:
Here’s how users would call nested groups:
Casing is automatically configured
Fern automatically handles choosing the appropriate casing for each SDK
language: snake_case in python, camelCase in TypeScript and PascalCase in
Go, etc. Because of this, you define the endpoint structure once and get
properly formatted methods across all generated SDKs.
Configure method names
OpenAPI
Use the x-fern-sdk-group-name and x-fern-sdk-method-name extensions to control how endpoints are organized in your SDK.
Fern automatically parses operationId
If no extensions are present, Fern uses your operation ID to generate SDK method names. Format operation IDs as {tag_name}_{operation_name} (example: users_get) to automatically generate methods like users.get(). If the operation ID doesn’t start with a tag, Fern uses it directly as the method name.
In the example below, Fern will generate a
method called client.users.create() for the POST /users endpoint.
Top level methods
If you omit the x-fern-sdk-group-name extension, the generated SDK method
will live at the root of the client rather than nested under a resource group.
In the example below, Fern will generate a method called client.send():
Multiple levels of nesting
See how merge.dev uses nested groups here.
If you add more than one x-fern-sdk-group-name extension, then the generated SDK will nest group names.
The generated SDK method preserves the order of group names.
In the example below, Fern will generate a method called client.users.notifications.send():
Fern Definition
For the Fern Definition, method names are directly mapped from your endpoint and service base-path.
In the example below, Fern will generate a method called client.users.create():