{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"$schema":{"description":"JSON Schema URL for editor autocomplete","type":"string"},"version":{"type":"number","const":1},"providers":{"type":"object","properties":{"anthropic":{"type":"object","properties":{"activeIndex":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Index of the account tried first for this provider"},"accounts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["oauth","api"],"description":"oauth accounts carry refresh/access/expires, api accounts carry key"},"refresh":{"description":"OAuth refresh token","type":"string"},"access":{"description":"OAuth access token","type":"string"},"expires":{"description":"Access token expiry as epoch milliseconds","type":"number"},"key":{"description":"API key for api accounts","type":"string"},"email":{"description":"Account email when the provider returns one","type":"string"},"accountId":{"description":"Provider account id when the provider returns one","type":"string"},"addedAt":{"type":"number","description":"Epoch milliseconds when the account was first stored"},"lastUsed":{"type":"number","description":"Epoch milliseconds when the account was last used"}},"required":["type","addedAt","lastUsed"],"description":"One stored subscription account"},"description":"Accounts in rotation order"}},"required":["activeIndex","accounts"],"description":"Account pool for one provider"},"openai":{"type":"object","properties":{"activeIndex":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Index of the account tried first for this provider"},"accounts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["oauth","api"],"description":"oauth accounts carry refresh/access/expires, api accounts carry key"},"refresh":{"description":"OAuth refresh token","type":"string"},"access":{"description":"OAuth access token","type":"string"},"expires":{"description":"Access token expiry as epoch milliseconds","type":"number"},"key":{"description":"API key for api accounts","type":"string"},"email":{"description":"Account email when the provider returns one","type":"string"},"accountId":{"description":"Provider account id when the provider returns one","type":"string"},"addedAt":{"type":"number","description":"Epoch milliseconds when the account was first stored"},"lastUsed":{"type":"number","description":"Epoch milliseconds when the account was last used"}},"required":["type","addedAt","lastUsed"],"description":"One stored subscription account"},"description":"Accounts in rotation order"}},"required":["activeIndex","accounts"],"description":"Account pool for one provider"},"xai":{"type":"object","properties":{"activeIndex":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Index of the account tried first for this provider"},"accounts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["oauth","api"],"description":"oauth accounts carry refresh/access/expires, api accounts carry key"},"refresh":{"description":"OAuth refresh token","type":"string"},"access":{"description":"OAuth access token","type":"string"},"expires":{"description":"Access token expiry as epoch milliseconds","type":"number"},"key":{"description":"API key for api accounts","type":"string"},"email":{"description":"Account email when the provider returns one","type":"string"},"accountId":{"description":"Provider account id when the provider returns one","type":"string"},"addedAt":{"type":"number","description":"Epoch milliseconds when the account was first stored"},"lastUsed":{"type":"number","description":"Epoch milliseconds when the account was last used"}},"required":["type","addedAt","lastUsed"],"description":"One stored subscription account"},"description":"Accounts in rotation order"}},"required":["activeIndex","accounts"],"description":"Account pool for one provider"},"opencode-go":{"type":"object","properties":{"activeIndex":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Index of the account tried first for this provider"},"accounts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["oauth","api"],"description":"oauth accounts carry refresh/access/expires, api accounts carry key"},"refresh":{"description":"OAuth refresh token","type":"string"},"access":{"description":"OAuth access token","type":"string"},"expires":{"description":"Access token expiry as epoch milliseconds","type":"number"},"key":{"description":"API key for api accounts","type":"string"},"email":{"description":"Account email when the provider returns one","type":"string"},"accountId":{"description":"Provider account id when the provider returns one","type":"string"},"addedAt":{"type":"number","description":"Epoch milliseconds when the account was first stored"},"lastUsed":{"type":"number","description":"Epoch milliseconds when the account was last used"}},"required":["type","addedAt","lastUsed"],"description":"One stored subscription account"},"description":"Accounts in rotation order"}},"required":["activeIndex","accounts"],"description":"Account pool for one provider"},"github-copilot":{"type":"object","properties":{"activeIndex":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Index of the account tried first for this provider"},"accounts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["oauth","api"],"description":"oauth accounts carry refresh/access/expires, api accounts carry key"},"refresh":{"description":"OAuth refresh token","type":"string"},"access":{"description":"OAuth access token","type":"string"},"expires":{"description":"Access token expiry as epoch milliseconds","type":"number"},"key":{"description":"API key for api accounts","type":"string"},"email":{"description":"Account email when the provider returns one","type":"string"},"accountId":{"description":"Provider account id when the provider returns one","type":"string"},"addedAt":{"type":"number","description":"Epoch milliseconds when the account was first stored"},"lastUsed":{"type":"number","description":"Epoch milliseconds when the account was last used"}},"required":["type","addedAt","lastUsed"],"description":"One stored subscription account"},"description":"Accounts in rotation order"}},"required":["activeIndex","accounts"],"description":"Account pool for one provider"},"poe":{"type":"object","properties":{"activeIndex":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Index of the account tried first for this provider"},"accounts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["oauth","api"],"description":"oauth accounts carry refresh/access/expires, api accounts carry key"},"refresh":{"description":"OAuth refresh token","type":"string"},"access":{"description":"OAuth access token","type":"string"},"expires":{"description":"Access token expiry as epoch milliseconds","type":"number"},"key":{"description":"API key for api accounts","type":"string"},"email":{"description":"Account email when the provider returns one","type":"string"},"accountId":{"description":"Provider account id when the provider returns one","type":"string"},"addedAt":{"type":"number","description":"Epoch milliseconds when the account was first stored"},"lastUsed":{"type":"number","description":"Epoch milliseconds when the account was last used"}},"required":["type","addedAt","lastUsed"],"description":"One stored subscription account"},"description":"Accounts in rotation order"}},"required":["activeIndex","accounts"],"description":"Account pool for one provider"},"minimax":{"type":"object","properties":{"activeIndex":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Index of the account tried first for this provider"},"accounts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["oauth","api"],"description":"oauth accounts carry refresh/access/expires, api accounts carry key"},"refresh":{"description":"OAuth refresh token","type":"string"},"access":{"description":"OAuth access token","type":"string"},"expires":{"description":"Access token expiry as epoch milliseconds","type":"number"},"key":{"description":"API key for api accounts","type":"string"},"email":{"description":"Account email when the provider returns one","type":"string"},"accountId":{"description":"Provider account id when the provider returns one","type":"string"},"addedAt":{"type":"number","description":"Epoch milliseconds when the account was first stored"},"lastUsed":{"type":"number","description":"Epoch milliseconds when the account was last used"}},"required":["type","addedAt","lastUsed"],"description":"One stored subscription account"},"description":"Accounts in rotation order"}},"required":["activeIndex","accounts"],"description":"Account pool for one provider"},"kimi":{"type":"object","properties":{"activeIndex":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Index of the account tried first for this provider"},"accounts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["oauth","api"],"description":"oauth accounts carry refresh/access/expires, api accounts carry key"},"refresh":{"description":"OAuth refresh token","type":"string"},"access":{"description":"OAuth access token","type":"string"},"expires":{"description":"Access token expiry as epoch milliseconds","type":"number"},"key":{"description":"API key for api accounts","type":"string"},"email":{"description":"Account email when the provider returns one","type":"string"},"accountId":{"description":"Provider account id when the provider returns one","type":"string"},"addedAt":{"type":"number","description":"Epoch milliseconds when the account was first stored"},"lastUsed":{"type":"number","description":"Epoch milliseconds when the account was last used"}},"required":["type","addedAt","lastUsed"],"description":"One stored subscription account"},"description":"Accounts in rotation order"}},"required":["activeIndex","accounts"],"description":"Account pool for one provider"},"zai":{"type":"object","properties":{"activeIndex":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Index of the account tried first for this provider"},"accounts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["oauth","api"],"description":"oauth accounts carry refresh/access/expires, api accounts carry key"},"refresh":{"description":"OAuth refresh token","type":"string"},"access":{"description":"OAuth access token","type":"string"},"expires":{"description":"Access token expiry as epoch milliseconds","type":"number"},"key":{"description":"API key for api accounts","type":"string"},"email":{"description":"Account email when the provider returns one","type":"string"},"accountId":{"description":"Provider account id when the provider returns one","type":"string"},"addedAt":{"type":"number","description":"Epoch milliseconds when the account was first stored"},"lastUsed":{"type":"number","description":"Epoch milliseconds when the account was last used"}},"required":["type","addedAt","lastUsed"],"description":"One stored subscription account"},"description":"Accounts in rotation order"}},"required":["activeIndex","accounts"],"description":"Account pool for one provider"},"alibaba":{"type":"object","properties":{"activeIndex":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Index of the account tried first for this provider"},"accounts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["oauth","api"],"description":"oauth accounts carry refresh/access/expires, api accounts carry key"},"refresh":{"description":"OAuth refresh token","type":"string"},"access":{"description":"OAuth access token","type":"string"},"expires":{"description":"Access token expiry as epoch milliseconds","type":"number"},"key":{"description":"API key for api accounts","type":"string"},"email":{"description":"Account email when the provider returns one","type":"string"},"accountId":{"description":"Provider account id when the provider returns one","type":"string"},"addedAt":{"type":"number","description":"Epoch milliseconds when the account was first stored"},"lastUsed":{"type":"number","description":"Epoch milliseconds when the account was last used"}},"required":["type","addedAt","lastUsed"],"description":"One stored subscription account"},"description":"Accounts in rotation order"}},"required":["activeIndex","accounts"],"description":"Account pool for one provider"}},"description":"Logged-in accounts grouped by provider"},"logins":{"type":"object","properties":{"anthropic":{"type":"object","properties":{"provider":{"type":"string","enum":["anthropic","openai","xai","opencode-go","github-copilot","poe","minimax","kimi","zai","alibaba"],"description":"Subscription provider id"},"status":{"type":"string","enum":["pending","error"],"description":"pending while a login daemon waits, error after a failed attempt"},"instructions":{"description":"Human instructions, including device codes as code: XXXX-XXXX","type":"string"},"url":{"description":"Authorize URL to open in a browser","type":"string"},"error":{"description":"Failure message when status is error","type":"string"}},"required":["provider","status"],"description":"In-progress or failed login for one provider"},"openai":{"type":"object","properties":{"provider":{"type":"string","enum":["anthropic","openai","xai","opencode-go","github-copilot","poe","minimax","kimi","zai","alibaba"],"description":"Subscription provider id"},"status":{"type":"string","enum":["pending","error"],"description":"pending while a login daemon waits, error after a failed attempt"},"instructions":{"description":"Human instructions, including device codes as code: XXXX-XXXX","type":"string"},"url":{"description":"Authorize URL to open in a browser","type":"string"},"error":{"description":"Failure message when status is error","type":"string"}},"required":["provider","status"],"description":"In-progress or failed login for one provider"},"xai":{"type":"object","properties":{"provider":{"type":"string","enum":["anthropic","openai","xai","opencode-go","github-copilot","poe","minimax","kimi","zai","alibaba"],"description":"Subscription provider id"},"status":{"type":"string","enum":["pending","error"],"description":"pending while a login daemon waits, error after a failed attempt"},"instructions":{"description":"Human instructions, including device codes as code: XXXX-XXXX","type":"string"},"url":{"description":"Authorize URL to open in a browser","type":"string"},"error":{"description":"Failure message when status is error","type":"string"}},"required":["provider","status"],"description":"In-progress or failed login for one provider"},"opencode-go":{"type":"object","properties":{"provider":{"type":"string","enum":["anthropic","openai","xai","opencode-go","github-copilot","poe","minimax","kimi","zai","alibaba"],"description":"Subscription provider id"},"status":{"type":"string","enum":["pending","error"],"description":"pending while a login daemon waits, error after a failed attempt"},"instructions":{"description":"Human instructions, including device codes as code: XXXX-XXXX","type":"string"},"url":{"description":"Authorize URL to open in a browser","type":"string"},"error":{"description":"Failure message when status is error","type":"string"}},"required":["provider","status"],"description":"In-progress or failed login for one provider"},"github-copilot":{"type":"object","properties":{"provider":{"type":"string","enum":["anthropic","openai","xai","opencode-go","github-copilot","poe","minimax","kimi","zai","alibaba"],"description":"Subscription provider id"},"status":{"type":"string","enum":["pending","error"],"description":"pending while a login daemon waits, error after a failed attempt"},"instructions":{"description":"Human instructions, including device codes as code: XXXX-XXXX","type":"string"},"url":{"description":"Authorize URL to open in a browser","type":"string"},"error":{"description":"Failure message when status is error","type":"string"}},"required":["provider","status"],"description":"In-progress or failed login for one provider"},"poe":{"type":"object","properties":{"provider":{"type":"string","enum":["anthropic","openai","xai","opencode-go","github-copilot","poe","minimax","kimi","zai","alibaba"],"description":"Subscription provider id"},"status":{"type":"string","enum":["pending","error"],"description":"pending while a login daemon waits, error after a failed attempt"},"instructions":{"description":"Human instructions, including device codes as code: XXXX-XXXX","type":"string"},"url":{"description":"Authorize URL to open in a browser","type":"string"},"error":{"description":"Failure message when status is error","type":"string"}},"required":["provider","status"],"description":"In-progress or failed login for one provider"},"minimax":{"type":"object","properties":{"provider":{"type":"string","enum":["anthropic","openai","xai","opencode-go","github-copilot","poe","minimax","kimi","zai","alibaba"],"description":"Subscription provider id"},"status":{"type":"string","enum":["pending","error"],"description":"pending while a login daemon waits, error after a failed attempt"},"instructions":{"description":"Human instructions, including device codes as code: XXXX-XXXX","type":"string"},"url":{"description":"Authorize URL to open in a browser","type":"string"},"error":{"description":"Failure message when status is error","type":"string"}},"required":["provider","status"],"description":"In-progress or failed login for one provider"},"kimi":{"type":"object","properties":{"provider":{"type":"string","enum":["anthropic","openai","xai","opencode-go","github-copilot","poe","minimax","kimi","zai","alibaba"],"description":"Subscription provider id"},"status":{"type":"string","enum":["pending","error"],"description":"pending while a login daemon waits, error after a failed attempt"},"instructions":{"description":"Human instructions, including device codes as code: XXXX-XXXX","type":"string"},"url":{"description":"Authorize URL to open in a browser","type":"string"},"error":{"description":"Failure message when status is error","type":"string"}},"required":["provider","status"],"description":"In-progress or failed login for one provider"},"zai":{"type":"object","properties":{"provider":{"type":"string","enum":["anthropic","openai","xai","opencode-go","github-copilot","poe","minimax","kimi","zai","alibaba"],"description":"Subscription provider id"},"status":{"type":"string","enum":["pending","error"],"description":"pending while a login daemon waits, error after a failed attempt"},"instructions":{"description":"Human instructions, including device codes as code: XXXX-XXXX","type":"string"},"url":{"description":"Authorize URL to open in a browser","type":"string"},"error":{"description":"Failure message when status is error","type":"string"}},"required":["provider","status"],"description":"In-progress or failed login for one provider"},"alibaba":{"type":"object","properties":{"provider":{"type":"string","enum":["anthropic","openai","xai","opencode-go","github-copilot","poe","minimax","kimi","zai","alibaba"],"description":"Subscription provider id"},"status":{"type":"string","enum":["pending","error"],"description":"pending while a login daemon waits, error after a failed attempt"},"instructions":{"description":"Human instructions, including device codes as code: XXXX-XXXX","type":"string"},"url":{"description":"Authorize URL to open in a browser","type":"string"},"error":{"description":"Failure message when status is error","type":"string"}},"required":["provider","status"],"description":"In-progress or failed login for one provider"}},"description":"Background login attempts, one per provider"}},"required":["version","providers","logins"],"description":"~/.subrouter/auth.json"}