# getFeeForMessage

## getFeeForMessage RPC Method

> Get the fee the network will charge for a particular Message.\
> \*\*Version Restriction\*\*: This method is only available in solana-core v1.9 or newer. Please use getFees for solana-core v1.8 and below.<br>

````json
{"openapi":"3.0.3","info":{"title":"Solana RPC API - getFeeForMessage Method","version":"1.0.0"},"tags":[{"name":"Fee Data","description":"Methods related to transaction fee calculation and retrieval. These methods\nhelp determine the cost of executing transactions on the Solana network.\n"}],"servers":[{"url":"https://public.rpc.solanavibestation.com"},{"url":"https://basic.rpc.solanavibestation.com"},{"url":"https://ultra.rpc.solanavibestation.com"},{"url":"https://elite.rpc.solanavibestation.com"},{"url":"https://epic.rpc.solanavibestation.com"},{"url":"https://basic.swqos.solanavibestation.com"},{"url":"https://ultra.swqos.solanavibestation.com"},{"url":"https://elite.swqos.solanavibestation.com"}],"security":[{},{"AuthHeader":[]},{"URLParameter":[]}],"components":{"securitySchemes":{"AuthHeader":{"type":"apiKey","in":"header","name":"Authorization","description":"Authorization header for API key authentication.\n\n**Example:**\n```\nAuthorization: your-api-key-here\n```\n"},"URLParameter":{"type":"apiKey","in":"query","name":"api_key","description":"API key passed as a URL parameter for authentication.\n\n**Example:**\n```\nhttps://public.rpc.solanavibestation.com/?api_key=your-api-key-here\n```\n"}},"schemas":{"GetFeeForMessageRequest":{"type":"object","required":["jsonrpc","id","method","params"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"number"}],"description":"Request identifier that will be returned in the response"},"method":{"type":"string","description":"The RPC method name","enum":["getFeeForMessage"]},"params":{"type":"array","description":"Method parameters:\n\n1. Message (string) - required - Base-64 encoded Message\n2. Configuration object (optional) - Configuration options for the request\n","minItems":1,"maxItems":2,"items":{"oneOf":[{"type":"string","description":"Base-64 encoded Message"},{"$ref":"#/components/schemas/FeeForMessageConfig"}]}}}},"FeeForMessageConfig":{"type":"object","description":"Configuration object for getFeeForMessage request","properties":{"commitment":{"type":"string","description":"The commitment describes how finalized a block is at that point in time. Options include: processed, confirmed, finalized\n","enum":["processed","confirmed","finalized"]},"minContextSlot":{"type":"integer","format":"int64","description":"The minimum slot that the request can be evaluated at","minimum":0}}},"GetFeeForMessageResponse":{"type":"object","description":"RPC response containing fee information for the message","required":["jsonrpc","id"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"number"}],"description":"Request identifier matching the original request"},"result":{"$ref":"#/components/schemas/FeeForMessageResult"},"error":{"$ref":"#/components/schemas/RpcError"}}},"FeeForMessageResult":{"type":"object","description":"Result containing fee information with context","required":["context","value"],"properties":{"context":{"$ref":"#/components/schemas/RpcContext"},"value":{"type":"integer","format":"int64","nullable":true,"description":"Fee corresponding to the message at the specified blockhash, in lamports","minimum":0}}},"RpcContext":{"type":"object","description":"Context information for the RPC response","required":["slot"],"properties":{"slot":{"type":"integer","format":"int64","description":"The slot at which the operation was evaluated","minimum":0}}},"RpcError":{"type":"object","description":"Standard JSON-RPC error object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Numeric error code following JSON-RPC 2.0 specification:\n- `-32700`: Parse error\n- `-32600`: Invalid request  \n- `-32601`: Method not found\n- `-32602`: Invalid params\n- `-32603`: Internal error\n- `-32005`: Too Many Requests\n- `-32003`: Unauthorized\n"},"message":{"type":"string","description":"Human-readable error message"},"data":{"type":"object","description":"Additional structured error information (optional)","additionalProperties":true}}}}},"paths":{"/":{"post":{"summary":"getFeeForMessage RPC Method","description":"Get the fee the network will charge for a particular Message.\n**Version Restriction**: This method is only available in solana-core v1.9 or newer. Please use getFees for solana-core v1.8 and below.\n","operationId":"getFeeForMessage","tags":["Fee Data"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetFeeForMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetFeeForMessageResponse"}}}},"401":{"description":"Unauthorized","content":{"text/plain":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden","content":{"text/plain":{"schema":{"type":"string"}}}},"429":{"description":"Too Many Requests","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
````
