Officially, it's against TOS. I'm told you can still make it work by adding this to ~/.config/opencode/opencode.json but it risks a ban and you definitely shouldn't do it.
{
"plugin": [
"opencode-anthropic-auth@latest"
]
}