> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://okx-demo.ferndocs.com/api/api-reference/account/get-config/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://okx-demo.ferndocs.com/_mcp/server. # Get account configuration GET https://www.okx.com/api/v5/account/config Retrieve the current account configuration, including account level, position mode, margin mode, Greeks type and permission settings. Reference: https://okx-demo.ferndocs.com/api/api-reference/account/get-config ## Authentication - `OK-ACCESS-KEY` header (required) — Your API key. - `OK-ACCESS-SIGN` header (required) — Base64-encoded HMAC-SHA256 signature of the prehash string. - `OK-ACCESS-TIMESTAMP` header (required) — ISO 8601 UTC timestamp, e.g. 2020-12-08T09:08:57.715Z. - `OK-ACCESS-PASSPHRASE` header (required) — The passphrase you set when creating the API key. ## Response ### 200 Successful response - `code` (string, optional) — Result code. `0` means success; any other value is an error code. - `msg` (string, optional) — Error message. Empty on success. - `data` (list of ApiV5AccountConfigGetResponsesContentApplicationJsonSchemaDataItems, optional) ## Types ### ApiV5AccountConfigGetResponsesContentApplicationJsonSchemaDataItems - `uid` (string, optional) — Account ID of current request. - `mainUid` (string, optional) — Main account ID. - `acctLv` (string, optional) — Account level: 1 Simple, 2 Single-currency margin, 3 Multi-currency margin, 4 Portfolio margin. - `posMode` (string, optional) — Position mode. - `autoLoan` (boolean, optional) — Whether to borrow coins automatically. - `greeksType` (string, optional) — Current display type of Greeks: PA (in coins), BS (in dollars). - `level` (string, optional) — The user level of the current real trading volume, e.g. Lv1. - `levelTmp` (string, optional) — Temporary experience user level of special users. - `ctIsoMode` (string, optional) — Contract isolated margin trading settings. - `mgnIsoMode` (string, optional) — Margin isolated margin trading settings. - `spotOffsetType` (string, optional) — Risk offset type, only applicable to portfolio margin account. - `roleType` (string, optional) — Role type: 0 general user, 1 leading trader, 2 copy trader. - `label` (string, optional) — API key note. - `ip` (string, optional) — IP addresses linked with the current API key. - `perm` (string, optional) — Permission of the current API key: read_only, trade, withdraw. - `kycLv` (string, optional) — Main account KYC level. ## Examples **Response** ```json { "code": "0", "msg": "", "data": [ { "uid": "44705892343619584", "mainUid": "44705892343619584", "acctLv": "2", "posMode": "long_short_mode", "autoLoan": false, "greeksType": "PA", "level": "Lv1", "levelTmp": "", "ctIsoMode": "automatic", "mgnIsoMode": "automatic", "spotOffsetType": "", "roleType": "0", "label": "v5 test", "ip": "", "perm": "read_only,withdraw,trade", "kycLv": "3", "acctStpMode": "cancel_maker", "enableSpotBorrow": false, "feeType": "0", "liquidationGear": "-1", "opAuth": "1", "settleCcy": "USDC", "settleCcyList": [ "USD", "USDC", "USDG" ], "spotBorrowAutoRepay": false, "spotRoleType": "0", "spotTraderInsts": [], "stgyType": "0", "traderInsts": [], "type": "0" } ] } ``` **SDK Code** ```python account_getConfig_example import requests url = "https://www.okx.com/api/v5/account/config" headers = {"OK-ACCESS-KEY": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript account_getConfig_example const url = 'https://www.okx.com/api/v5/account/config'; const options = {method: 'GET', headers: {'OK-ACCESS-KEY': ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go account_getConfig_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://www.okx.com/api/v5/account/config" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("OK-ACCESS-KEY", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby account_getConfig_example require 'uri' require 'net/http' url = URI("https://www.okx.com/api/v5/account/config") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["OK-ACCESS-KEY"] = '' response = http.request(request) puts response.read_body ``` ```java account_getConfig_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://www.okx.com/api/v5/account/config") .header("OK-ACCESS-KEY", "") .asString(); ``` ```php account_getConfig_example request('GET', 'https://www.okx.com/api/v5/account/config', [ 'headers' => [ 'OK-ACCESS-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp account_getConfig_example using RestSharp; var client = new RestClient("https://www.okx.com/api/v5/account/config"); var request = new RestRequest(Method.GET); request.AddHeader("OK-ACCESS-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift account_getConfig_example import Foundation let headers = ["OK-ACCESS-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://www.okx.com/api/v5/account/config")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```