***

title: joke
slug: /reference/python/agents/skills/joke
description: Tell jokes using the API Ninjas joke API.
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[ref-datamap]: /docs/server-sdks/reference/python/agents/data-map

Tell jokes using the API Ninjas joke API. Uses a [DataMap][ref-datamap] for serverless execution.

**Tools:** `get_joke` (default, customizable via `tool_name`)

**Requirements:** API Ninjas API key

<ParamField path="api_key" type="str" required={true} toc={true}>
  API Ninjas API key for the joke service. Can also be set via the `API_NINJAS_KEY`
  environment variable.
</ParamField>

<ParamField path="tool_name" type="str" default="get_joke" toc={true}>
  Custom function name.
</ParamField>

```python
from signalwire import AgentBase

class MyAgent(AgentBase):
    def __init__(self):
        super().__init__(name="assistant", route="/assistant")
        self.set_prompt_text("You are a helpful assistant.")
        self.add_skill("joke", {
            "api_key": "YOUR_API_NINJAS_KEY"
        })

agent = MyAgent()
agent.serve()
```