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

# API Call • AI Agents Framework

> api_call: Context manager for profiling API calls.

# api\_call

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

> This is a method of the [**Profiler**](../classes/Profiler) class in the [**profiler**](../modules/profiler) module.

Context manager for profiling API calls.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def api_call(endpoint: str, method: str) -> Any
```

## Parameters

<ParamField query="endpoint" type="str" required={true}>
  No description available.
</ParamField>

<ParamField query="method" type="str" required={false} default="'GET'">
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="Any">
  The result of the operation.
</ResponseField>

## Uses

* `time.perf_counter`
* `cls.record_api_call`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai/praisonai/profiler.py#L483">
  `praisonai/profiler.py` at line 483
</Card>
