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

# Has Middleware • AI Agent SDK

> has_middleware: Check if middleware is registered for a runtime.

# has\_middleware

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**MiddlewareRegistry**](../classes/MiddlewareRegistry) class in the [**middleware\_registry**](../modules/middleware_registry) module.

Check if middleware is registered for a runtime.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def has_middleware(runtime_id: str) -> bool
```

## Parameters

<ParamField query="runtime_id" type="str" required={true}>
  Runtime identifier to check
</ParamField>

### Returns

<ResponseField name="Returns" type="bool">
  True if custom middleware is registered, False otherwise
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/runtime/middleware_registry.py#L92">
  `praisonaiagents/runtime/middleware_registry.py` at line 92
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Middleware Feature" icon="layer-group" href="/docs/docs/features/middleware" />
</CardGroup>
