customize-sdk-hooks

Implement BeforeRequestHook, AfterSuccessHook, and AfterErrorHook in Speakeasy-generated SDKs.

Updated Feb 28, 2026
One-click install
npx skills add https://github.com/CarlosEGuerraSilva/OpenRouterSDK.NET --skill customize-sdk-hooks-carloseguerrasilva
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: customize-sdk-hooks
Source: https://github.com/CarlosEGuerraSilva/OpenRouterSDK.NET/tree/main/.agents/skills/customize-sdk-hooks
Command: npx skills add https://github.com/CarlosEGuerraSilva/OpenRouterSDK.NET --skill customize-sdk-hooks-carloseguerrasilva

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill allows developers to seamlessly integrate custom code logic into the lifecycle of a Speakeasy-generated SDK, enabling advanced customization beyond standard API definitions.

Core Features & Use Cases

  • Request/Response Interception: Modify requests before they are sent or responses after they are received.
  • Custom Logic Injection: Add telemetry, custom headers, authentication (like HMAC signing), or data transformation.
  • Use Case: You need to add a custom X-Correlation-ID header to every request made by your generated SDK to trace requests across services.

Quick Start

Use the customize-sdk-hooks skill to add a custom User-Agent header to all SDK requests.

Frequently Asked Questions about customize-sdk-hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add custom headers to every request made by a Speakeasy-generated SDK?

You can add custom headers to Speakeasy SDK requests by implementing a BeforeRequestHook to inject logic like X-Correlation-ID or User-Agent values before the request is sent.

Can I intercept and modify API responses after they are received by the SDK?

Yes, you can intercept API responses using AfterSuccessHook and AfterErrorHook to modify response data, implement telemetry tracking, or execute custom response transformation logic.

Does Speakeasy SDK lifecycle management support multiple programming languages?

Speakeasy SDK lifecycle management supports multiple languages including TypeScript, Go, Python, Java, C#, Ruby, and PHP for implementing custom request and response hooks.

How do I implement HMAC signing for API requests in a generated SDK?

You can implement HMAC signing by using a BeforeRequestHook to inject custom authentication logic into the SDK lifecycle, allowing you to sign requests before they are transmitted.

What are the available hook types for customizing SDK behavior in Speakeasy?

The available hook types are BeforeRequestHook, AfterSuccessHook, and AfterErrorHook, enabling custom logic injection for request modification, telemetry, and error handling respectively.

What's the best way to add telemetry tracking to a Speakeasy-generated SDK?

The best way to add telemetry tracking is by implementing AfterSuccessHook and AfterErrorHook to capture lifecycle events, allowing you to monitor request outcomes and errors across services.