> ## 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.

# aexecute • AI Agent SDK

> aexecute: Execute code asynchronously.

# aexecute

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

> This is a method of the [**CodeAgent**](../classes/CodeAgent) class in the [**code\_agent**](../modules/code_agent) module.

Execute code asynchronously.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async def aexecute(code: str, language: str) -> Dict[str, Any]
```

## Parameters

<ParamField query="code" type="str" required={true}>
  Code to execute
</ParamField>

<ParamField query="language" type="str" required={false} default="'python'">
  Programming language \*\*kwargs: Additional options
</ParamField>

### Returns

<ResponseField name="Returns" type="Dict[str, Any]">
  Execution result dictionary
</ResponseField>

## Uses

* `asyncio.get_event_loop`
* `loop.run_in_executor`
* `execute`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/code_agent.py#L315">
  `praisonaiagents/agent/code_agent.py` at line 315
</Card>
