```  
<Tip>
From within your Space, secrets are available as environment variables (or
Streamlit Secrets Management if using Streamlit). No need to fetch them via the API!
</Tip>  
<Tip warning={true}>
Any change in your Space configuration (secrets or hardware) will trigger a restart of your app.
</Tip>  
**Bonus: set secrets and variables when creating or duplicating the Space!**  
Secrets and variables can be set when creating or duplicating a space:  
```py
>>> api.create_repo(
...     repo_id=repo_id,