---
title: "How-to guides · Axios plugin · Kubb"
description: "How-to guides for @kubb/plugin-axios, the Kubb Axios plugin. Each guide walks through one task."
canonical_url: "https://kubb.dev/extensions/kubb-labs/plugin-axios/guides"
meta:
  author: "Stijn Van Hulle"
  keywords: "kubb, openapi to typescript, openapi code generator, swagger to typescript, typescript api client, zod, tanstack query, react query, msw, code generation, type safety"
  "og:description": "How-to guides for @kubb/plugin-axios, the Kubb Axios plugin. Each guide walks through one task."
  "og:image": "https://kubb.dev/_og/s/o_b377ccb97c73bde4.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "How-to guides · Axios plugin · Kubb"
  "twitter:image": "https://kubb.dev/_og/s/o_b377ccb97c73bde4.png"
---

> Index of every page on this site: [llms.txt](https://kubb.dev/llms.txt)

![Axios logo](https://kubb.dev/feature/axios.svg)

**Axios**

Officialv5.11.0

@kubb/plugin-axios

**$**kubb add plugin-axioskubb add plugin-axios

# **How-to guides**

8 guides

[**Authenticate requests**Set an auth resolver on the generated client. Operations use the security schemes declared in your OpenAPI spec. Requests remain unauthenticated until you provide credentials.](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/authentication) [**Set the base URL**Set baseURL on the client plugin or on the generated client.](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/base-url) [**Call operations**The generated client accepts grouped request options on every operation and returns a typed RequestResult by default.](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/calling-operations) [**Handle errors**Handle failures from the client Kubb generates. Catch a ResponseError, switch to a returned error result with throwOnError, and tell a network failure apart from a 4xx or 5xx response.](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/error-handling) [**Add interceptors**Register handlers on client.interceptors.request, .response, or .error to apply behavior across calls. Handlers receive native Axios objects.](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/interceptors) [**Configure serialization**The generated client encodes parameters using OpenAPI style and explode, serializes request bodies by content type, and decodes responses by media type. Each generated operation carries its parameter styles and content types, so most requests need no extra setup.](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/serialization) [**Server-sent events**Operations returning text/event-stream produce a typed stream rather than a RequestResult. The client switches to the axios fetch adapter for these calls unless you set adapter yourself, because the default XHR adapter buffers the whole body.](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/server-sent-events) [**Use a custom transport**Set a transport at runtime to replace the network send. The client still builds URLs, serializes parameters, resolves authentication, and handles results.](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/transport)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://kubb.dev/#website","@type":"WebSite","description":"Kubb is an open source code generator that turns an API spec into TypeScript types, API clients, TanStack Query hooks, Zod schemas and mocks.","name":"Kubb","url":"https://kubb.dev/","publisher":{"@id":"https://kubb.dev/#identity"}},{"@id":"https://kubb.dev/extensions/kubb-labs/plugin-axios/guides#webpage","@type":"WebPage","description":"How-to guides for @kubb/plugin-axios, the Kubb Axios plugin. Each guide walks through one task.","name":"How-to guides · Axios plugin · Kubb","url":"https://kubb.dev/extensions/kubb-labs/plugin-axios/guides","isPartOf":{"@id":"https://kubb.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://kubb.dev/extensions/kubb-labs/plugin-axios/guides"]}],"primaryImageOfPage":{"@id":"https://kubb.dev/#logo"}},{"@id":"https://kubb.dev/#identity","@type":"Organization","description":"Kubb is an open source code generator. It turns an API spec, such as OpenAPI, into TypeScript types, API clients, TanStack Query hooks, Zod schemas and mocks.","email":"kubb@kubb.dev","name":"Kubb","url":"https://kubb.dev","founder":{"@id":"https://kubb.dev/#founder"},"logo":{"@id":"https://kubb.dev/#logo"},"sameAs":["https://github.com/kubb-labs/kubb","https://discord.gg/shfBFeczrm","https://www.linkedin.com/company/kubb-labs"]},{"@id":"https://kubb.dev/#logo","@type":"ImageObject","caption":"Kubb","contentUrl":"https://kubb.dev/logo.png","inLanguage":"en","url":"https://kubb.dev/logo.png"}]}
```

## Sitemap

See the full [sitemap](https://kubb.dev/sitemap.md) for all pages.
