Skip to content
skyl

Escape Hatches

skyl must never be the reason you cannot ship.

Every abstraction over a fast-moving API is wrong somewhere. skyl's answer is to be escapable in every direction — you can send fields it does not model, read fields it does not parse, replace the transport, observe every attempt, write your own adapter, or bypass the client entirely.

In this chapter

  • How to send a vendor field skyl has no equivalent for
  • How to read a response field skyl does not parse
  • How to supply your own *http.Client
  • How to observe every attempt without touching your call sites
  • How to implement Provider yourself, in your own repository
  • How to skip Client when you want the raw provider

Provider options#

goCompiles
req.ProviderOptions = map[string]any{"top_k": 40}
req.ProviderOptions = map[string]any{"top_k": 40}

Your keys are merged into the outbound payload, overriding anything skyl set.

Read Provider Options — the merge is shallow on three of four adapters, and that will bite you.

Read more →

Raw responses#

goCompiles
var full map[string]any
json.Unmarshal(resp.Raw, &full)
var full map[string]any
json.Unmarshal(resp.Raw, &full)

Read Raw Responses for what is guaranteed and what streaming changes.

Read more →

Your own HTTP client#

Read Custom HTTP Client for proxies, transport timeouts, mTLS, and trace propagation.

Read more →

Hooks#

Read Hooks for the four operations, and the one field that will leak your users' prompts if you log it.

Read more →

Your own provider#

Read Writing Your Own Provider — four methods, and you inherit retry, hooks and the gateway for free.

Read more →

Bypassing the client#

Read Bypassing the Client for when you want the provider without validation or retry.

Read more →

What’s next?

Start with Provider Options — it is the hatch you will reach for first. If you are here because a vendor feature is missing, that page and Raw Responses between them cover almost every case.

Edit this page on GitHub