A simple method is with fancyvrb
and fvextra
:
\documentclass{article}
\usepackage{fancyvrb,fvextra}
\usepackage{showframe} % just for the example
\begin{document}
\begin{Verbatim}[breaklines]
curl -v -s -X POST $OS_AUTH_URL/auth/tokens?nocatalog -H "Content-Type: application/json" -d '{ "auth": { "identity": { "methods": ["password"],"password": {"user": {"domain": {"name": "'"$OS_USER_DOMAIN_NAME"'"},"name": "'"$OS_USERNAME"'", "password": "'"$OS_PASSWORD"'"} } }, "scope": { "project": { "domain": { "name": "Default" }, "name": "'"$OS_PROJECT_NAME"'" } } }}' | python -m json.tool
\end{Verbatim}
\end{document}

The example uses showframe
just for being sure the breaks respect the text width.
For also having syntax highlighting you can use minted
:
\documentclass{article}
\usepackage{minted}
\usepackage{showframe} % just for the example
\begin{document}
\begin{minted}[breaklines]{bash}
curl -v -s -X POST $OS_AUTH_URL/auth/tokens?nocatalog -H "Content-Type: application/json" -d '{ "auth": { "identity": { "methods": ["password"],"password": {"user": {"domain": {"name": "'"$OS_USER_DOMAIN_NAME"'"},"name": "'"$OS_USERNAME"'", "password": "'"$OS_PASSWORD"'"} } }, "scope": { "project": { "domain": { "name": "Default" }, "name": "'"$OS_PROJECT_NAME"'" } } }}' | python -m json.tool
\end{minted}
\end{document}

In both cases, the character after the break can be customized.