Implementation vs Documentation
This guide only covers how to document your security requirements in OpenAPI. To implement the actual authentication logic, see How to add custom authentication.
Default Schema
The default security scheme varies by deployment type:- LangSmith
x-api-key header:
- Self-hosted
Custom Security Schema
To customize the security schema in your OpenAPI documentation, add anopenapi field to your auth configuration in langgraph.json. Remember that this only updates the API documentation - you must also implement the corresponding authentication logic as shown in How to add custom authentication.
Note that LangSmith does not provide authentication endpoints - you’ll need to handle user authentication in your client application and pass the resulting credentials to the LangGraph API.
- OAuth2 with Bearer Token
- API Key
Testing
After updating your configuration:- Deploy your application
- Visit
/docsto see the updated OpenAPI documentation - Try out the endpoints using credentials from your authentication server (make sure you’ve implemented the authentication logic first)
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.