> ## Documentation Index
> Fetch the complete documentation index at: https://docs.illa.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom provider & routes

> Override base URL, routes, and inject a custom Axios instance

Customize `CoreApiProvider` for observability, auth, or environment routing.

<Warning>
  Advanced/optional: skip this unless you have a concrete infrastructure requirement
  (for example proxy routing, custom gateway paths, or Axios interceptors).
</Warning>

## Override base URL and routes

```ts theme={null}
import { CoreApiProvider } from '@illalabs/sdk'

const provider = new CoreApiProvider({
  headers: { 'x-api-key': process.env.ILLA_API_KEY! },
  baseURL: 'https://api.illa.io',
  routes: {
    chat: '/api/v1/chat/',
    actionStatus: '/api/v1/actions/check',
  },
})
```

## Inject a custom Axios client

```ts theme={null}
import { CoreApiProvider } from '@illalabs/sdk'
import axios from 'axios'

const provider = new CoreApiProvider({
  headers: { 'x-api-key': process.env.ILLA_API_KEY! },
  httpClientFactory: (config) => {
    const client = axios.create(config)

    client.interceptors.request.use((req) => {
      console.debug('[core-api] =>', req.method, req.url)
      return req
    })

    client.interceptors.response.use((res) => {
      console.debug('[core-api] <=', res.status, res.config.url)
      return res
    })

    return client
  },
})
```
