# Unique ID

Unique ID is part of AI response endpoint. It is used to create a new session for a specific user. What does that mean? Read next.

### What does session mean?

So, when you create a new session with an `uid` or unique ID, It actually stores your data you tell the bot in that ID so bot will remember your name etc. You can use the ID later and bot will remember you.

{% hint style="info" %}
If you don't provide a unique ID, It will store the info globally in your API key instead.
{% endhint %}

The unique ID can be anything, you should use secure unique IDs. Use `utils.generate_unique_id()` method to create a strong unique ID.

## Example

Hard to explain right? Here is an example

```python
import randomstuff

client = randomstuff.Client(api_key="api-key")
response = client.get_ai_response("What is my name?", 
    uid="a very unique id",
)
print(response)
```

The bot will respond with something like "What is your name?" and then when you will tell your name, it will remember it in ID: `a very unique id`. It will remember all the things you tell until you change the ID.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nerdguyahmad.gitbook.io/randomstuff/brief/unique-id.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
