# BasicAuthCredential 类 (/zh-CN/api-reference/conversational-ai/restclient-java/basicauthcredential) > For AI agents: see the complete documentation index at [llms.txt](/llms.txt). ## BasicAuthCredential [#basicauthcredential] ```java public BasicAuthCredential(String username, String password) ``` 使用从控制台获取的客户 ID 和客户密钥初始化 [`BasicAuthCredential`](/zh-CN/api-reference/conversational-ai/restclient-java/basicauthcredential)。 #### 参数 [#参数] | 参数 | 数据类型 | 描述 | | --- | --- | --- | | `username` | `String` | 从控制台获取的[客户 ID](/zh-CN/introduction/glossary#客户-id-和客户密钥)。 | | `password` | `String` | 从控制台获取的[客户密钥](/zh-CN/introduction/glossary#客户-id-和客户密钥)。 |